Package org.opensaml.security.x509
Class X509SupportTest
java.lang.Object
org.opensaml.security.x509.X509SupportTest
Tests the X509Support utility methods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate Stringprivate Integerprivate Integerprivate Integerprivate Stringprivate Stringprivate StringA PEM encoded cert.private StringAn EC certificate.private StringA PEM encoded cert.private StringA PEM encoded CRL.private StringA PEM encoded CRL.private X509Certificateprivate X509Certificateprivate Stringprivate X509Certificateprivate Stringprivate X509Certificateprivate Stringprivate X509Certificateprivate Stringprivate X509Certificateprivate Stringprivate X509Certificateprivate Stringprivate Stringprivate PrivateKeyprivate Stringprivate static final StringInvalid base64 string as it has invalid trailing digits.private StringAn EC private key.private static String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate List<?>getAltNames(X509Certificate cert, Set<Integer> nameTypes) Get the alt names from the certificate.protected voidsetUp()voidTest decoding a DER encoded cert.voidTest decoding a PEM encoded cert.voidTest decoding a DER encoded CRL.voidTest decoding a PEM encoded CRL.voidTest decoding invalid cert encoding.voidTests that the entity cert is correctly identified in the collection.voidtestEC()Test decoding and matching EC keypair.voidTest common name (CN) extraction from X500Principal.voidTest 1 alt name: DNS.voidTest 1 alt name: IP.voidTest 1 alt name: URI (URL).voidTest 1 alt name: URI (URN).voidTest 3 alt names: DNS, URI (URL), IP.voidTest 3 alt names: DNS, URI (URN), IP.voidTest Subject Key Identifier (SKI) extraction from certificate.
-
Field Details
-
entityPrivateKey
-
entityPrivKeyBase64
-
entityCert
-
entityCertBase64
-
entityCert3AltNamesDNS_URL_IP
-
entityCert3AltNamesDNS_URL_IPBase64
-
entityCert3AltNamesDNS_URN_IP
-
entityCert3AltNamesDNS_URN_IPBase64
-
entityCert1AltNameDNS
-
entityCert1AltNameDNSBase64
-
entityCert1AltNameURN
-
entityCert1AltNameURNBase64
-
entityCert1AltNameURL
-
entityCert1AltNameURLBase64
-
entityCert1AltNameIP
-
entityCert1AltNameIPBase64
-
altNameDNS
-
altNameURN
-
altNameURL
-
altNameIP
-
altNameTypeDNS
-
altNameTypeURI
-
altNameTypeIP
-
subjectAltNameExtensionOID
-
certPEM
A PEM encoded cert. -
certDER
A PEM encoded cert. -
crlPEM
A PEM encoded CRL. -
crlDER
A PEM encoded CRL. -
certEC
An EC certificate. -
keyEC
An EC private key. -
INVALID_BASE64_TRAILING
Invalid base64 string as it has invalid trailing digits.- See Also:
-
-
Constructor Details
-
X509SupportTest
public X509SupportTest()
-
-
Method Details
-
setUp
- Throws:
Exception
-
testGetCommonNames
public void testGetCommonNames()Test common name (CN) extraction from X500Principal. -
testGetSubjectKeyIdentifier
public void testGetSubjectKeyIdentifier() throws org.apache.commons.codec.DecoderExceptionTest Subject Key Identifier (SKI) extraction from certificate.- Throws:
org.apache.commons.codec.DecoderException- ...
-
testDetermineEntityCertificate
Tests that the entity cert is correctly identified in the collection.- Throws:
Exception- if something goes wrong
-
testGetSubjectAltNames1NameDNS
Test 1 alt name: DNS.- Throws:
SecurityException- ...CertificateParsingException- ...
-
testGetSubjectAltNames1NameURN
Test 1 alt name: URI (URN).- Throws:
SecurityException- ...CertificateParsingException- ...
-
testGetSubjectAltNames1NameURL
Test 1 alt name: URI (URL).- Throws:
SecurityException- ...CertificateParsingException- ...
-
testGetSubjectAltNames1NameIP
Test 1 alt name: IP.- Throws:
SecurityException- ...CertificateParsingException- ...
-
testGetSubjectAltNames3NamesDNS_URL_IP
public void testGetSubjectAltNames3NamesDNS_URL_IP() throws SecurityException, CertificateParsingExceptionTest 3 alt names: DNS, URI (URL), IP.- Throws:
SecurityException- ...CertificateParsingException- ...
-
testGetSubjectAltNames3NamesDNS_URN_IP
public void testGetSubjectAltNames3NamesDNS_URN_IP() throws SecurityException, CertificateParsingExceptionTest 3 alt names: DNS, URI (URN), IP.- Throws:
SecurityException- ...CertificateParsingException- ...
-
testDecodeCertPEM
Test decoding a PEM encoded cert.- Throws:
Exception- if something goes wrong
-
testDecodeCRLWithInvalidBase64
Test decoding invalid cert encoding.- Throws:
CertificateExceptionCRLException
-
testDecodeCertDER
Test decoding a DER encoded cert.- Throws:
Exception- if something goes wrong
-
testDecodeCRLPEM
Test decoding a PEM encoded CRL.- Throws:
Exception- if something goes wrong
-
testDecodeCRLDER
Test decoding a DER encoded CRL.- Throws:
Exception- if something goes wrong
-
testEC
Test decoding and matching EC keypair.- Throws:
Exception- if something goes wrong
-
getAltNames
Get the alt names from the certificate.- Parameters:
cert- the cert to processnameTypes- set of Integers identifying which alt name types to extract- Returns:
- list of alt name value Objects
-