Package org.opensaml.security.crypto
Class SigningUtilTest
- java.lang.Object
-
- org.opensaml.security.crypto.SigningUtilTest
-
public class SigningUtilTest extends Object
Test the SigningUtil operations for generating and verifying simple, raw signatures and MAC's.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]controlSignatureHMACprivate byte[]controlSignatureRSAprivate org.opensaml.security.credential.CredentialcredAESprivate org.opensaml.security.credential.CredentialcredRSAprivate Stringdataprivate StringhmacJCAAlgorithmprivate KeyPairkeyPairRSAprivate StringrsaJCAAlgorithmprivate SecretKeysecretKeyAES128
-
Constructor Summary
Constructors Constructor Description SigningUtilTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private byte[]getControlSignature(byte[] data1, PrivateKey privateKey, String algorithm)private byte[]getControlSignature(byte[] data1, SecretKey secretKey, String algorithm)protected voidsetUp()voidtestSigningWithHMAC()voidtestSigningWithPrivateKey()voidtestVerificationWithHMAC()voidtestVerificationWithPublicKey()
-
-
-
Field Detail
-
secretKeyAES128
private SecretKey secretKeyAES128
-
keyPairRSA
private KeyPair keyPairRSA
-
credAES
private org.opensaml.security.credential.Credential credAES
-
credRSA
private org.opensaml.security.credential.Credential credRSA
-
data
private String data
-
controlSignatureRSA
private byte[] controlSignatureRSA
-
controlSignatureHMAC
private byte[] controlSignatureHMAC
-
rsaJCAAlgorithm
private String rsaJCAAlgorithm
-
hmacJCAAlgorithm
private String hmacJCAAlgorithm
-
-
Constructor Detail
-
SigningUtilTest
public SigningUtilTest() throws NoSuchAlgorithmException, NoSuchProviderException
-
-
Method Detail
-
setUp
@BeforeMethod protected void setUp() throws Exception
- Throws:
Exception
-
testSigningWithPrivateKey
public void testSigningWithPrivateKey() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testSigningWithHMAC
public void testSigningWithHMAC() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testVerificationWithPublicKey
public void testVerificationWithPublicKey() throws org.opensaml.security.SecurityException, NoSuchAlgorithmException, NoSuchProviderException- Throws:
org.opensaml.security.SecurityExceptionNoSuchAlgorithmExceptionNoSuchProviderException
-
testVerificationWithHMAC
public void testVerificationWithHMAC() throws org.opensaml.security.SecurityException, NoSuchAlgorithmException, NoSuchProviderException- Throws:
org.opensaml.security.SecurityExceptionNoSuchAlgorithmExceptionNoSuchProviderException
-
getControlSignature
private byte[] getControlSignature(byte[] data1, SecretKey secretKey, String algorithm) throws NoSuchAlgorithmException, InvalidKeyException
-
getControlSignature
private byte[] getControlSignature(byte[] data1, PrivateKey privateKey, String algorithm) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException
-
-