Package org.opensaml.xmlsec.keyinfo.impl
Class X509KeyInfoGeneratorTest
- java.lang.Object
-
- org.opensaml.core.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.xml.XMLObjectBaseTestCase
-
- org.opensaml.xmlsec.keyinfo.impl.X509KeyInfoGeneratorTest
-
public class X509KeyInfoGeneratorTest extends org.opensaml.core.xml.XMLObjectBaseTestCaseTests the factory and impl for X509KeyInfoGenerator.
-
-
Field Summary
Fields Modifier and Type Field Description private StringaltName1private IntegeraltName1Typeprivate StringaltName2private IntegeraltName2Typeprivate StringaltName3private IntegeraltName3Typeprivate X509CertificatecaCertprivate StringcaCertBase64private X509CRLcaCRLprivate StringcaCRLBase64private org.opensaml.security.x509.BasicX509Credentialcredentialprivate X509CertificateentityCertprivate StringentityCertBase64private StringentityCertDigestBase64private StringentityCertSKIBase64private StringentityIDprivate org.opensaml.xmlsec.keyinfo.impl.X509KeyInfoGeneratorFactoryfactoryprivate org.opensaml.xmlsec.keyinfo.KeyInfoGeneratorgeneratorprivate X500PrincipalissuerNameprivate StringkeyNameBarprivate StringkeyNameFooprivate PublicKeypubKeyprivate BigIntegerserialNumberprivate static StringsubjectAltNameExtensionOIDprivate StringsubjectCNprivate byte[]subjectKeyIdentifierprivate X500PrincipalsubjectNameprivate byte[]x509Digest
-
Constructor Summary
Constructors Constructor Description X509KeyInfoGeneratorTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidsetUp()voidtestEmitCertAndChainCombo()Test combo options of cert and chain - don't emit duplicate of entity cert.voidtestEmitCRLs()Test emit CRLs.voidtestEmitEntityCert()Test emit entity cert.voidtestEmitEntityCertChain()Test emit entity cert chain in X509Data.voidtestEmitEntityIDAsKeyName()Test emit entity ID as key name.voidtestEmitKeynames()Test emit credential key names.voidtestEmitKeyNamesCombo()Test emitting combinations of key names.voidtestEmitPublicKey()Test emit public key.voidtestEmitSubjectAltNamesAsKeyNames()Test emit subject alt names as key names.voidtestEmitSubjectCNAsKeyName()Test emit subject CN as key name.voidtestEmitSubjectDNAsKeyName()Test emit subject DN as key name.voidtestEmitX509Digest()Test emit X509Digest in X509Data.voidtestEmitX509IssuerSerial()Test emit issuer name and serial number in X509Data.voidtestEmitX509SKI()Test emit subject key identifier in X509Data.voidtestEmitX509SubjectName()Test emit subject name in X509Data.voidtestNoOptions()Test no options - should produce null KeyInfo.voidtestProperOptionsCloning()Test that the options passed to the generator are really cloned.-
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
-
subjectAltNameExtensionOID
private static String subjectAltNameExtensionOID
-
credential
private org.opensaml.security.x509.BasicX509Credential credential
-
factory
private org.opensaml.xmlsec.keyinfo.impl.X509KeyInfoGeneratorFactory factory
-
generator
private org.opensaml.xmlsec.keyinfo.KeyInfoGenerator generator
-
keyNameFoo
private String keyNameFoo
-
keyNameBar
private String keyNameBar
-
entityID
private String entityID
-
pubKey
private PublicKey pubKey
-
entityCert
private X509Certificate entityCert
-
entityCertBase64
private String entityCertBase64
-
entityCertSKIBase64
private String entityCertSKIBase64
-
entityCertDigestBase64
private String entityCertDigestBase64
-
caCert
private X509Certificate caCert
-
caCertBase64
private String caCertBase64
-
subjectCN
private String subjectCN
-
subjectName
private X500Principal subjectName
-
issuerName
private X500Principal issuerName
-
serialNumber
private BigInteger serialNumber
-
subjectKeyIdentifier
private byte[] subjectKeyIdentifier
-
x509Digest
private byte[] x509Digest
-
altName1
private String altName1
-
altName2
private String altName2
-
altName3
private String altName3
-
altName1Type
private Integer altName1Type
-
altName2Type
private Integer altName2Type
-
altName3Type
private Integer altName3Type
-
caCRL
private X509CRL caCRL
-
caCRLBase64
private String caCRLBase64
-
-
Method Detail
-
setUp
@BeforeMethod protected void setUp() throws Exception
- Throws:
Exception
-
testNoOptions
public void testNoOptions() throws org.opensaml.security.SecurityExceptionTest no options - should produce null KeyInfo.- Throws:
org.opensaml.security.SecurityException- ...
-
testEmitPublicKey
public void testEmitPublicKey() throws org.opensaml.security.SecurityException, KeyExceptionTest emit public key.- Throws:
org.opensaml.security.SecurityException- ...KeyException- ...
-
testEmitKeynames
public void testEmitKeynames() throws org.opensaml.security.SecurityExceptionTest emit credential key names.- Throws:
org.opensaml.security.SecurityException- ...
-
testEmitEntityIDAsKeyName
public void testEmitEntityIDAsKeyName() throws org.opensaml.security.SecurityExceptionTest emit entity ID as key name.- Throws:
org.opensaml.security.SecurityException- ...
-
testEmitEntityCert
public void testEmitEntityCert() throws org.opensaml.security.SecurityException, CertificateExceptionTest emit entity cert.- Throws:
org.opensaml.security.SecurityException- ...CertificateException- ...
-
testEmitEntityCertChain
public void testEmitEntityCertChain() throws org.opensaml.security.SecurityException, CertificateExceptionTest emit entity cert chain in X509Data.- Throws:
org.opensaml.security.SecurityException- ...CertificateException- ...
-
testEmitCertAndChainCombo
public void testEmitCertAndChainCombo() throws org.opensaml.security.SecurityException, CertificateExceptionTest combo options of cert and chain - don't emit duplicate of entity cert.- Throws:
org.opensaml.security.SecurityException- ...CertificateException- ...
-
testEmitCRLs
public void testEmitCRLs() throws org.opensaml.security.SecurityException, CRLExceptionTest emit CRLs.- Throws:
org.opensaml.security.SecurityException- ...CRLException- ...
-
testEmitX509SubjectName
public void testEmitX509SubjectName() throws org.opensaml.security.SecurityExceptionTest emit subject name in X509Data.- Throws:
org.opensaml.security.SecurityException- ...
-
testEmitX509IssuerSerial
public void testEmitX509IssuerSerial() throws org.opensaml.security.SecurityExceptionTest emit issuer name and serial number in X509Data.- Throws:
org.opensaml.security.SecurityException- ...
-
testEmitX509SKI
public void testEmitX509SKI() throws org.opensaml.security.SecurityException, net.shibboleth.utilities.java.support.codec.DecodingExceptionTest emit subject key identifier in X509Data.- Throws:
org.opensaml.security.SecurityException- ...net.shibboleth.utilities.java.support.codec.DecodingException- if the base64 key identifier can not be decoded.
-
testEmitX509Digest
public void testEmitX509Digest() throws org.opensaml.security.SecurityException, net.shibboleth.utilities.java.support.codec.DecodingExceptionTest emit X509Digest in X509Data.- Throws:
org.opensaml.security.SecurityException- ...net.shibboleth.utilities.java.support.codec.DecodingException- if the base64 digest value can not be decoded.
-
testEmitSubjectDNAsKeyName
public void testEmitSubjectDNAsKeyName() throws org.opensaml.security.SecurityExceptionTest emit subject DN as key name.- Throws:
org.opensaml.security.SecurityException- ...
-
testEmitSubjectCNAsKeyName
public void testEmitSubjectCNAsKeyName() throws org.opensaml.security.SecurityExceptionTest emit subject CN as key name.- Throws:
org.opensaml.security.SecurityException- ...
-
testEmitSubjectAltNamesAsKeyNames
public void testEmitSubjectAltNamesAsKeyNames() throws org.opensaml.security.SecurityException, CertificateParsingExceptionTest emit subject alt names as key names.- Throws:
org.opensaml.security.SecurityException- ...CertificateParsingException- ...
-
testEmitKeyNamesCombo
public void testEmitKeyNamesCombo() throws org.opensaml.security.SecurityExceptionTest emitting combinations of key names.- Throws:
org.opensaml.security.SecurityException- ...
-
testProperOptionsCloning
public void testProperOptionsCloning() throws org.opensaml.security.SecurityExceptionTest that the options passed to the generator are really cloned. After newInstance() is called, changes to the factory options should not be reflected in the generator.- Throws:
org.opensaml.security.SecurityException- ...
-
-