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 XMLObjectBaseTestCase
Tests 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 BasicX509Credentialcredentialprivate X509CertificateentityCertprivate StringentityCertBase64private StringentityCertDigestBase64private StringentityCertSKIBase64private StringentityIDprivate X509KeyInfoGeneratorFactoryfactoryprivate KeyInfoGeneratorgeneratorprivate X500PrincipalissuerNameprivate StringkeyNameBarprivate StringkeyNameFooprivate PublicKeypubKeyprivate BigIntegerserialNumberprivate static StringsubjectAltNameExtensionOIDprivate StringsubjectCNprivate byte[]subjectKeyIdentifierprivate X500PrincipalsubjectNameprivate byte[]x509Digest-
Fields inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase
builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory
-
-
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
-
Methods inherited from class org.opensaml.core.OpenSAMLInitBaseTestCase
initOpenSAML
-
-
-
-
Field Detail
-
subjectAltNameExtensionOID
private static String subjectAltNameExtensionOID
-
credential
private BasicX509Credential credential
-
factory
private X509KeyInfoGeneratorFactory factory
-
generator
private 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 SecurityExceptionTest no options - should produce null KeyInfo.- Throws:
SecurityException- ...
-
testEmitPublicKey
public void testEmitPublicKey() throws SecurityException, KeyExceptionTest emit public key.- Throws:
SecurityException- ...KeyException- ...
-
testEmitKeynames
public void testEmitKeynames() throws SecurityExceptionTest emit credential key names.- Throws:
SecurityException- ...
-
testEmitEntityIDAsKeyName
public void testEmitEntityIDAsKeyName() throws SecurityExceptionTest emit entity ID as key name.- Throws:
SecurityException- ...
-
testEmitEntityCert
public void testEmitEntityCert() throws SecurityException, CertificateExceptionTest emit entity cert.- Throws:
SecurityException- ...CertificateException- ...
-
testEmitEntityCertChain
public void testEmitEntityCertChain() throws SecurityException, CertificateExceptionTest emit entity cert chain in X509Data.- Throws:
SecurityException- ...CertificateException- ...
-
testEmitCertAndChainCombo
public void testEmitCertAndChainCombo() throws SecurityException, CertificateExceptionTest combo options of cert and chain - don't emit duplicate of entity cert.- Throws:
SecurityException- ...CertificateException- ...
-
testEmitCRLs
public void testEmitCRLs() throws SecurityException, CRLExceptionTest emit CRLs.- Throws:
SecurityException- ...CRLException- ...
-
testEmitX509SubjectName
public void testEmitX509SubjectName() throws SecurityExceptionTest emit subject name in X509Data.- Throws:
SecurityException- ...
-
testEmitX509IssuerSerial
public void testEmitX509IssuerSerial() throws SecurityExceptionTest emit issuer name and serial number in X509Data.- Throws:
SecurityException- ...
-
testEmitX509SKI
public void testEmitX509SKI() throws SecurityException, DecodingExceptionTest emit subject key identifier in X509Data.- Throws:
SecurityException- ...DecodingException- if the base64 key identifier can not be decoded.
-
testEmitX509Digest
public void testEmitX509Digest() throws SecurityException, DecodingExceptionTest emit X509Digest in X509Data.- Throws:
SecurityException- ...DecodingException- if the base64 digest value can not be decoded.
-
testEmitSubjectDNAsKeyName
public void testEmitSubjectDNAsKeyName() throws SecurityExceptionTest emit subject DN as key name.- Throws:
SecurityException- ...
-
testEmitSubjectCNAsKeyName
public void testEmitSubjectCNAsKeyName() throws SecurityExceptionTest emit subject CN as key name.- Throws:
SecurityException- ...
-
testEmitSubjectAltNamesAsKeyNames
public void testEmitSubjectAltNamesAsKeyNames() throws SecurityException, CertificateParsingExceptionTest emit subject alt names as key names.- Throws:
SecurityException- ...CertificateParsingException- ...
-
testEmitKeyNamesCombo
public void testEmitKeyNamesCombo() throws SecurityExceptionTest emitting combinations of key names.- Throws:
SecurityException- ...
-
testProperOptionsCloning
public void testProperOptionsCloning() throws 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:
SecurityException- ...
-
-