Package org.opensaml.xmlsec.crypto
Class XMLSigningUtilTest
- java.lang.Object
-
- org.opensaml.core.testing.OpenSAMLInitBaseTestCase
-
- org.opensaml.xmlsec.crypto.XMLSigningUtilTest
-
public class XMLSigningUtilTest extends OpenSAMLInitBaseTestCase
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 CredentialcredAESprivate CredentialcredRSAprivate Stringdataprivate StringhmacAlgorithmURIprivate StringhmacJCAAlgorithmprivate KeyPairkeyPairRSAprivate StringrsaAlgorithmURIprivate StringrsaJCAAlgorithmprivate SecretKeysecretKeyAES128
-
Constructor Summary
Constructors Constructor Description XMLSigningUtilTest()
-
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()-
Methods inherited from class org.opensaml.core.testing.OpenSAMLInitBaseTestCase
initOpenSAML
-
-
-
-
Field Detail
-
secretKeyAES128
private SecretKey secretKeyAES128
-
keyPairRSA
private KeyPair keyPairRSA
-
credAES
private Credential credAES
-
credRSA
private Credential credRSA
-
data
private String data
-
controlSignatureRSA
private byte[] controlSignatureRSA
-
controlSignatureHMAC
private byte[] controlSignatureHMAC
-
rsaAlgorithmURI
private String rsaAlgorithmURI
-
rsaJCAAlgorithm
private String rsaJCAAlgorithm
-
hmacAlgorithmURI
private String hmacAlgorithmURI
-
hmacJCAAlgorithm
private String hmacJCAAlgorithm
-
-
Constructor Detail
-
XMLSigningUtilTest
public XMLSigningUtilTest() throws NoSuchAlgorithmException, NoSuchProviderException
-
-
Method Detail
-
testSigningWithPrivateKey
public void testSigningWithPrivateKey() throws SecurityException- Throws:
SecurityException
-
testSigningWithHMAC
public void testSigningWithHMAC() throws SecurityException- Throws:
SecurityException
-
testVerificationWithPublicKey
public void testVerificationWithPublicKey() throws SecurityException, NoSuchAlgorithmException, NoSuchProviderException
-
testVerificationWithHMAC
public void testVerificationWithHMAC() throws SecurityException, NoSuchAlgorithmException, NoSuchProviderException
-
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
-
-