Class KeyInfoSupportTest
java.lang.Object
org.opensaml.core.testing.OpenSAMLInitBaseTestCase
org.opensaml.core.testing.XMLObjectBaseTestCase
org.opensaml.xmlsec.keyinfo.tests.KeyInfoSupportTest
public class KeyInfoSupportTest
extends org.opensaml.core.testing.XMLObjectBaseTestCase
Test to exercise the KeyInfoSupport methods to convert between XMLObject's contained within KeyInfo and Java security
native types.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringTest cert 1.private final StringTest cert 1 SHA-1 digest.private final StringTest cert 1 SKI value.private final StringTest cert subject DN 1.private final StringTest cert 2.private final StringTest cert subject DN 2.private final StringCert which contains no X.509 v3 extensions.private final StringTest CRL 1.private final StringTest cert issuer DN 1.private final StringTest DH key 1.private final StringTest DSA key 1.private final StringTest EC key with explicit params variant 1, curve: secp256r1, OID: 1.2.840.10045.3.1.7private final StringOID of the curve for ecPubKey_ExplicitParams1, curve: secp256r1.private final StringTest EC key with named curve variant 1, curve: secp256r1, OID: 1.2.840.10045.3.1.7private final StringOID of the curve for ecPubKey_NamedCurve1, curve: secp256r1.private X509Certificateprivate X509CRLprivate DHPublicKeyprivate DSAParamsprivate DSAPublicKeyprivate ECPublicKeyprivate ECPublicKeyprivate RSAPublicKeyprivate KeyInfoprivate KeyValueprivate intprivate intprivate final StringTest RSA key 1.private X509Certificateprivate X509Certificateprivate X509CRLprivate DHKeyValueprivate DSAKeyValueprivate DSAKeyValueprivate ECKeyValueprivate ECKeyValueprivate RSAKeyValueprivate X509DataFields inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate ECPublicKeybuildECPublicKeyWithExplicitParams(String encodedKey) protected voidsetUp()voidTests adding a public key as a DEREncodedKeyValue to KeyInfo.voidTests adding a public key as a DEREncodedKeyValue to KeyInfo.voidTests adding a public key as a DEREncodedKeyValue to KeyInfo.voidTests adding a public key as a DEREncodedKeyValue to KeyInfo.voidTests adding a public key as a DEREncodedKeyValue to KeyInfo.voidTests adding a public key as a KeyValue to KeyInfo.voidTests adding a public key as a KeyValue to KeyInfo.voidTests adding a public key as a KeyValue to KeyInfo.voidTests adding a public key as a KeyValue to KeyInfo.voidTests adding a public key as a KeyValue to KeyInfo.voidTests adding a certificate as a X509Data/X509Certificate to KeyInfo.voidTests adding a CRL as a X509Data/X509CRL to KeyInfo.voidTests building a new X509Digest from a certificate.voidTests building a new X509IssuerSerial.voidTests building a new X509SKI from a certificate containing an SKI value.voidTests building a new X509SubjectName.voidTest converting java.security.cert.X509Certificate to XML X509Certificate.voidTest converting XML X509Certificate to java.security.cert.X509Certificate.voidTest converting java.security.cert.X509CRL to XML X509CRL.voidTest converting XML X509CRL to java.security.cert.X509CRL.voidTest conversion of DH public keys from Java security native type to XML.voidTest conversion of DH public keys from XML to Java security native type.voidTest conversion of DSA public keys from Java security native type to XML.voidTest conversion of DSA public keys from XML to Java security native type.voidTest conversion of EC public keys from Java security native type to XML.voidTest conversion of EC public keys from Java security native type to XML.voidTest conversion of EC public keys from XML to Java security native type.voidTest conversion of EC public keys from XML to Java security native type.voidTests extracting a DH public key from a KeyValue.voidTests extracting a DSA public key from a KeyValue.voidTests extracting a RSA public key from a KeyValue.voidTest conversion of RSA public keys from Java security native type to XML.voidTest conversion of RSA public keys from XML to Java security native type.Methods inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElementMethods inherited from class org.opensaml.core.testing.OpenSAMLInitBaseTestCase
initOpenSAML
-
Field Details
-
certNoExtensions
Cert which contains no X.509 v3 extensions.- See Also:
-
cert1SubjectDN
Test cert subject DN 1.- See Also:
-
cert1SKIPlainBase64
Test cert 1 SKI value. Base64 encoded version of cert's plain (non-DER encoded) subject key identifier, which is: AF:B9:F9:1D:C2:45:18:CC:B8:21:E2:A7:47:BC:49:BD:19:B5:78:28- See Also:
-
cert1DigestBase64
Test cert 1 SHA-1 digest.- See Also:
-
cert1
Test cert 1.- See Also:
-
cert2SubjectDN
Test cert subject DN 2.- See Also:
-
cert2
Test cert 2.- See Also:
-
crl1IssuerDN
Test cert issuer DN 1.- See Also:
-
crl1
Test CRL 1.- See Also:
-
rsaPubKey1
Test RSA key 1.- See Also:
-
dsaPubKey1
Test DSA key 1.- See Also:
-
dhPubKey1
Test DH key 1.- See Also:
-
ecPubKey_NamedCurve1
Test EC key with named curve variant 1, curve: secp256r1, OID: 1.2.840.10045.3.1.7- See Also:
-
ecPubKey_NamedCurve1_OID
OID of the curve for ecPubKey_NamedCurve1, curve: secp256r1.- See Also:
-
ecPubKey_ExplicitParams1
Test EC key with explicit params variant 1, curve: secp256r1, OID: 1.2.840.10045.3.1.7- See Also:
-
ecPubKey_ExplicitParams1_OID
OID of the curve for ecPubKey_ExplicitParams1, curve: secp256r1.- See Also:
-
xmlCert1
-
xmlCert2
-
xmlCRL1
-
xmlX509Data
-
keyInfo
-
keyValue
-
xmlDSAKeyValue1
-
xmlDSAKeyValue1NoParams
-
xmlDHKeyValue1
-
xmlRSAKeyValue1
-
xmlECKeyValue_NamedCurve1
-
xmlECKeyValue_ExplicitParams1
-
numExpectedCerts
private int numExpectedCerts -
numExpectedCRLs
private int numExpectedCRLs -
javaCert1
-
javaCRL1
-
javaRSAPubKey1
-
javaDSAPubKey1
-
javaDHPubKey1
-
javaECPubKey_NamedCurve1
-
javaECPubKey_ExplicitParams1
-
javaDSAParams1
-
-
Constructor Details
-
KeyInfoSupportTest
public KeyInfoSupportTest()Constructor.
-
-
Method Details
-
setUp
- Throws:
Exception
-
testCertConversionXMLtoJava
Test converting XML X509Certificate to java.security.cert.X509Certificate.- Throws:
CertificateException- ...
-
testCRLConversionXMLtoJava
Test converting XML X509CRL to java.security.cert.X509CRL.- Throws:
CRLException- ...CertificateException- ...
-
testCertConversionJavaToXML
Test converting java.security.cert.X509Certificate to XML X509Certificate.- Throws:
CertificateException- ...
-
testCRLConversionJavaToXML
Test converting java.security.cert.X509CRL to XML X509CRL.- Throws:
CRLException- ...CertificateException- ...
-
testDSAConversionXMLToJava
public void testDSAConversionXMLToJava()Test conversion of DSA public keys from XML to Java security native type. -
testDHConversionXMLToJava
public void testDHConversionXMLToJava()Test conversion of DH public keys from XML to Java security native type. -
testRSAConversionXMLToJava
public void testRSAConversionXMLToJava()Test conversion of RSA public keys from XML to Java security native type. -
testECConversionXMLToJavaWithNamedCurve
public void testECConversionXMLToJavaWithNamedCurve()Test conversion of EC public keys from XML to Java security native type. -
testECConversionXMLToJavaWithExplicitParameters
public void testECConversionXMLToJavaWithExplicitParameters()Test conversion of EC public keys from XML to Java security native type. -
testDHConversionJavaToXML
Test conversion of DH public keys from Java security native type to XML.- Throws:
EncodingException- on base64 encoding error
-
testDSAConversionJavaToXML
Test conversion of DSA public keys from Java security native type to XML.- Throws:
EncodingException- on base64 encoding error
-
testRSAConversionJavaToXML
Test conversion of RSA public keys from Java security native type to XML.- Throws:
EncodingException- on base64 encoding error
-
testECConversionJavaToXMLWithNamedCurve
public void testECConversionJavaToXMLWithNamedCurve() throws EncodingException, KeyException, DecodingExceptionTest conversion of EC public keys from Java security native type to XML.- Throws:
EncodingException- on base64 encoding errorDecodingExceptionKeyException
-
testECConversionJavaToXMLWithExplicitParameters
public void testECConversionJavaToXMLWithExplicitParameters() throws EncodingException, KeyException, DecodingExceptionTest conversion of EC public keys from Java security native type to XML.- Throws:
EncodingException- on base64 encoding errorDecodingExceptionKeyException
-
testGetDHKey
public void testGetDHKey()Tests extracting a DH public key from a KeyValue. -
testGetDSAKey
public void testGetDSAKey()Tests extracting a DSA public key from a KeyValue. -
testGetRSAKey
public void testGetRSAKey()Tests extracting a RSA public key from a KeyValue. -
testAddDSAPublicKey
Tests adding a public key as a KeyValue to KeyInfo.- Throws:
EncodingException- on base64 encoding error
-
testAddDHPublicKey
Tests adding a public key as a KeyValue to KeyInfo.- Throws:
EncodingException- on base64 encoding error
-
testAddRSAPublicKey
Tests adding a public key as a KeyValue to KeyInfo.- Throws:
EncodingException- on base64 encoding error
-
testAddECPublicKeyWithNamedCurve
Tests adding a public key as a KeyValue to KeyInfo.- Throws:
EncodingException- on base64 encoding error
-
testAddECPublicKeyWithExplicitParams
Tests adding a public key as a KeyValue to KeyInfo.- Throws:
EncodingException- on base64 encoding error
-
testAddDEREncodedDSAPublicKey
public void testAddDEREncodedDSAPublicKey()Tests adding a public key as a DEREncodedKeyValue to KeyInfo. -
testAddDEREncodedRSAPublicKey
public void testAddDEREncodedRSAPublicKey()Tests adding a public key as a DEREncodedKeyValue to KeyInfo. -
testAddDEREncodedECPublicKeyWithNamedCurve
public void testAddDEREncodedECPublicKeyWithNamedCurve()Tests adding a public key as a DEREncodedKeyValue to KeyInfo. -
testAddDEREncodedECPublicKeyWithExplictParams
public void testAddDEREncodedECPublicKeyWithExplictParams()Tests adding a public key as a DEREncodedKeyValue to KeyInfo. -
testAddDEREncodedDHPublicKey
public void testAddDEREncodedDHPublicKey()Tests adding a public key as a DEREncodedKeyValue to KeyInfo. -
testAddX509Certificate
Tests adding a certificate as a X509Data/X509Certificate to KeyInfo.- Throws:
CertificateException- ...
-
testAddX509CRL
Tests adding a CRL as a X509Data/X509CRL to KeyInfo.- Throws:
CRLException- ...
-
testBuildSubjectName
public void testBuildSubjectName()Tests building a new X509SubjectName. -
testBuildIssuerSerial
public void testBuildIssuerSerial()Tests building a new X509IssuerSerial. -
testBuildSubjectKeyIdentifier
public void testBuildSubjectKeyIdentifier() throws CertificateException, DecodingException, SecurityExceptionTests building a new X509SKI from a certificate containing an SKI value.- Throws:
CertificateException- ...DecodingException- if an issue base64-decoding SKI valuesSecurityException- if an issue building X509SKI.
-
testBuildDigest
Tests building a new X509Digest from a certificate.- Throws:
CertificateException- ...DecodingException- if an issue base64-decoding digests.
-
buildECPublicKeyWithExplicitParams
- Throws:
KeyException
-