Package org.opensaml.xmlsec.keyinfo
Class KeyInfoSupportTest
- java.lang.Object
-
- org.opensaml.core.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.xml.XMLObjectBaseTestCase
-
- org.opensaml.xmlsec.keyinfo.KeyInfoSupportTest
-
public class KeyInfoSupportTest extends org.opensaml.core.xml.XMLObjectBaseTestCaseTest to exercise the KeyInfoSupport methods to convert between XMLObject's contained within KeyInfo and Java security native types.
-
-
Field Summary
Fields Modifier and Type Field Description private Stringcert1Test cert 1.private Stringcert1DigestBase64Test cert 1 SHA-1 digest.private Stringcert1SKIPlainBase64Test cert 1 SKI value.private Stringcert1SubjectDNTest cert subject DN 1.private Stringcert2Test cert 2.private Stringcert2SubjectDNTest cert subject DN 2.private StringcertNoExtensionsCert which contains no X.509 v3 extensions.private Stringcrl1Test CRL 1.private Stringcrl1IssuerDNTest cert issuer DN 1.private StringdsaPubKey1Test DSA key 1.private X509CertificatejavaCert1private X509CRLjavaCRL1private DSAParamsjavaDSAParams1private DSAPublicKeyjavaDSAPubKey1private RSAPublicKeyjavaRSAPubKey1private org.opensaml.xmlsec.signature.KeyInfokeyInfoprivate org.opensaml.xmlsec.signature.KeyValuekeyValueprivate intnumExpectedCertsprivate intnumExpectedCRLsprivate StringrsaPubKey1Test RSA key 1.private org.opensaml.xmlsec.signature.X509CertificatexmlCert1private org.opensaml.xmlsec.signature.X509CertificatexmlCert2private org.opensaml.xmlsec.signature.X509CRLxmlCRL1private org.opensaml.xmlsec.signature.DSAKeyValuexmlDSAKeyValue1private org.opensaml.xmlsec.signature.DSAKeyValuexmlDSAKeyValue1NoParamsprivate org.opensaml.xmlsec.signature.RSAKeyValuexmlRSAKeyValue1private org.opensaml.xmlsec.signature.X509DataxmlX509Data
-
Constructor Summary
Constructors Constructor Description KeyInfoSupportTest()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidsetUp()voidtestAddDEREncodedDSAPublicKey()Tests adding a public key as a DEREncodedKeyValue to KeyInfo.voidtestAddDEREncodedRSAPublicKey()Tests adding a public key as a DEREncodedKeyValue to KeyInfo.voidtestAddDSAPublicKey()Tests adding a public key as a KeyValue to KeyInfo.voidtestAddRSAPublicKey()Tests adding a public key as a KeyValue to KeyInfo.voidtestAddX509Certificate()Tests adding a certificate as a X509Data/X509Certificate to KeyInfo.voidtestAddX509CRL()Tests adding a CRL as a X509Data/X509CRL to KeyInfo.voidtestBuildDigest()Tests building a new X509Digest from a certificate.voidtestBuildIssuerSerial()Tests building a new X509IssuerSerial.voidtestBuildSubjectKeyIdentifier()Tests building a new X509SKI from a certificate containing an SKI value.voidtestBuildSubjectName()Tests building a new X509SubjectName.voidtestCertConversionJavaToXML()Test converting java.security.cert.X509Certificate to XML X509Certificate.voidtestCertConversionXMLtoJava()Test converting XML X509Certificate to java.security.cert.X509Certificate.voidtestCRLConversionJavaToXML()Test converting java.security.cert.X509CRL to XML X509CRL.voidtestCRLConversionXMLtoJava()Test converting XML X509CRL to java.security.cert.X509CRL.voidtestDSAConversionJavaToXML()Test conversion of DSA public keys from Java security native type to XML.voidtestDSAConversionXMLToJava()Test conversion of DSA public keys from XML to Java security native type.voidtestGetDSAKey()Tests extracting a DSA public key from a KeyValue.voidtestGetRSAKey()Tests extracting a RSA public key from a KeyValue.voidtestRSAConversionJavaToXML()Test conversion of RSA public keys from Java security native type to XML.voidtestRSAConversionXMLToJava()Test conversion of RSA public keys from XML to Java security native type.-
Methods inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase
assertXMLEquals, assertXMLEquals, buildXMLObject, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElement, unmarshallElement
-
-
-
-
Field Detail
-
certNoExtensions
private final String certNoExtensions
Cert which contains no X.509 v3 extensions.- See Also:
- Constant Field Values
-
cert1SubjectDN
private final String cert1SubjectDN
Test cert subject DN 1.- See Also:
- Constant Field Values
-
cert1SKIPlainBase64
private final String 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:
- Constant Field Values
-
cert1DigestBase64
private final String cert1DigestBase64
Test cert 1 SHA-1 digest.- See Also:
- Constant Field Values
-
cert1
private final String cert1
Test cert 1.- See Also:
- Constant Field Values
-
cert2SubjectDN
private final String cert2SubjectDN
Test cert subject DN 2.- See Also:
- Constant Field Values
-
cert2
private final String cert2
Test cert 2.- See Also:
- Constant Field Values
-
crl1IssuerDN
private final String crl1IssuerDN
Test cert issuer DN 1.- See Also:
- Constant Field Values
-
crl1
private final String crl1
Test CRL 1.- See Also:
- Constant Field Values
-
rsaPubKey1
private final String rsaPubKey1
Test RSA key 1.- See Also:
- Constant Field Values
-
dsaPubKey1
private final String dsaPubKey1
Test DSA key 1.- See Also:
- Constant Field Values
-
xmlCert1
private org.opensaml.xmlsec.signature.X509Certificate xmlCert1
-
xmlCert2
private org.opensaml.xmlsec.signature.X509Certificate xmlCert2
-
xmlCRL1
private org.opensaml.xmlsec.signature.X509CRL xmlCRL1
-
xmlX509Data
private org.opensaml.xmlsec.signature.X509Data xmlX509Data
-
keyInfo
private org.opensaml.xmlsec.signature.KeyInfo keyInfo
-
keyValue
private org.opensaml.xmlsec.signature.KeyValue keyValue
-
xmlDSAKeyValue1
private org.opensaml.xmlsec.signature.DSAKeyValue xmlDSAKeyValue1
-
xmlDSAKeyValue1NoParams
private org.opensaml.xmlsec.signature.DSAKeyValue xmlDSAKeyValue1NoParams
-
xmlRSAKeyValue1
private org.opensaml.xmlsec.signature.RSAKeyValue xmlRSAKeyValue1
-
numExpectedCerts
private int numExpectedCerts
-
numExpectedCRLs
private int numExpectedCRLs
-
javaCert1
private X509Certificate javaCert1
-
javaCRL1
private X509CRL javaCRL1
-
javaRSAPubKey1
private RSAPublicKey javaRSAPubKey1
-
javaDSAPubKey1
private DSAPublicKey javaDSAPubKey1
-
javaDSAParams1
private DSAParams javaDSAParams1
-
-
Method Detail
-
setUp
@BeforeMethod protected void setUp() throws Exception
- Throws:
Exception
-
testCertConversionXMLtoJava
public void testCertConversionXMLtoJava() throws CertificateExceptionTest converting XML X509Certificate to java.security.cert.X509Certificate.- Throws:
CertificateException- ...
-
testCRLConversionXMLtoJava
public void testCRLConversionXMLtoJava() throws CertificateException, CRLExceptionTest converting XML X509CRL to java.security.cert.X509CRL.- Throws:
CRLException- ...CertificateException- ...
-
testCertConversionJavaToXML
public void testCertConversionJavaToXML() throws CertificateExceptionTest converting java.security.cert.X509Certificate to XML X509Certificate.- Throws:
CertificateException- ...
-
testCRLConversionJavaToXML
public void testCRLConversionJavaToXML() throws CertificateException, CRLExceptionTest 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.
-
testRSAConversionXMLToJava
public void testRSAConversionXMLToJava()
Test conversion of RSA public keys from XML to Java security native type.
-
testDSAConversionJavaToXML
public void testDSAConversionJavaToXML() throws net.shibboleth.utilities.java.support.codec.EncodingExceptionTest conversion of DSA public keys from Java security native type to XML.- Throws:
net.shibboleth.utilities.java.support.codec.EncodingException- on base64 encoding error
-
testRSAConversionJavaToXML
public void testRSAConversionJavaToXML() throws net.shibboleth.utilities.java.support.codec.EncodingExceptionTest conversion of RSA public keys from Java security native type to XML.- Throws:
net.shibboleth.utilities.java.support.codec.EncodingException- on base64 encoding error
-
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
public void testAddDSAPublicKey() throws net.shibboleth.utilities.java.support.codec.EncodingExceptionTests adding a public key as a KeyValue to KeyInfo.- Throws:
net.shibboleth.utilities.java.support.codec.EncodingException- on base64 encoding error
-
testAddRSAPublicKey
public void testAddRSAPublicKey() throws net.shibboleth.utilities.java.support.codec.EncodingExceptionTests adding a public key as a KeyValue to KeyInfo.- Throws:
net.shibboleth.utilities.java.support.codec.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.
-
testAddX509Certificate
public void testAddX509Certificate() throws CertificateExceptionTests adding a certificate as a X509Data/X509Certificate to KeyInfo.- Throws:
CertificateException- ...
-
testAddX509CRL
public void testAddX509CRL() throws CRLExceptionTests 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, net.shibboleth.utilities.java.support.codec.DecodingException, org.opensaml.security.SecurityExceptionTests building a new X509SKI from a certificate containing an SKI value.- Throws:
CertificateException- ...net.shibboleth.utilities.java.support.codec.DecodingException- if an issue base64-decoding SKI valuesorg.opensaml.security.SecurityException- if an issue building X509SKI.
-
testBuildDigest
public void testBuildDigest() throws CertificateException, net.shibboleth.utilities.java.support.codec.DecodingExceptionTests building a new X509Digest from a certificate.- Throws:
CertificateException- ...net.shibboleth.utilities.java.support.codec.DecodingException- if an issue base64-decoding digests.
-
-