Class PKIXSignatureTrustEngineTest
java.lang.Object
org.opensaml.core.testing.OpenSAMLInitBaseTestCase
org.opensaml.core.testing.XMLObjectBaseTestCase
org.opensaml.xmlsec.signature.support.impl.PKIXSignatureTrustEngineTest
public class PKIXSignatureTrustEngineTest
extends org.opensaml.core.testing.XMLObjectBaseTestCase
Tests the
PKIXSignatureTrustEngine implementation.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CriteriaSetprivate static final Stringprivate booleanprivate booleanprivate static final Set<X509Certificate>private PKIXSignatureTrustEngineprivate static final Integerprivate Stringprivate Credentialprivate Stringprivate byte[]private byte[]private Signatureprivate Stringprivate booleanFields inherited from class org.opensaml.core.testing.XMLObjectBaseTestCase
builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate SignableXMLObjectbuildSignedObject(X509Credential signingX509Cred) private X509CertificategetCertificate(String fileName) private Collection<X509Certificate>getCertificates(String... certNames) private BasicX509CredentialgetCredential(String entityCertFileName, String entityKeyFileName, String... chainMembers) private X509CRLprivate Collection<X509CRL>private PKIXSignatureTrustEnginegetEngine(Collection<X509Certificate> certs, Collection<X509CRL> crls, Integer depth, String... trustedNames) private InputStreamgetInputStream(String fileName) private PKIXValidationInformationgetPKIXInfoSet(Collection<X509Certificate> certs, Collection<X509CRL> crls, Integer depth) private PrivateKeygetPrivateKey(String fileName) private SignaturegetSignature(String entityCertFileName, String entityKeyFileName, String... chainMembers) protected voidsetUp()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidprivate voidtestRawValidateFailure(String message) private voidtestRawValidateSuccess(String message) voidvoidvoidprivate voidtestValidateFailure(String message) private voidtestValidateSuccess(String message) voidvoidMethods 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
-
DATA_PATH
- See Also:
-
EMPTY_CRLS
-
EMPTY_ANCHORS
-
MAX_DEPTH
-
engine
-
signature
-
criteriaSet
-
subjectCN
-
tamperDocumentPostSigning
private boolean tamperDocumentPostSigning -
emitKeyInfo
private boolean emitKeyInfo -
emitKeyValueOnly
private boolean emitKeyValueOnly -
rawData
-
rawSignedContent
private byte[] rawSignedContent -
rawAlgorithmURI
-
rawSignature
private byte[] rawSignature -
rawCandidateCred
-
-
Constructor Details
-
PKIXSignatureTrustEngineTest
public PKIXSignatureTrustEngineTest()
-
-
Method Details
-
setUp
- Throws:
Exception
-
testGoodPathInAnchors
public void testGoodPathInAnchors() -
testGoodPathInCred
public void testGoodPathInCred() -
testGoodPathNoTrustedNames
public void testGoodPathNoTrustedNames() -
testGoodPathBadTrustedName
public void testGoodPathBadTrustedName() -
testCertRevoked
public void testCertRevoked() -
testCertExpired
public void testCertExpired() -
testMissingAnchor
public void testMissingAnchor() -
testNoAnchors
public void testNoAnchors() -
testTamperedData
- Throws:
SecurityException
-
testNoCandidateCred
- Throws:
SecurityException
-
testWrongCredType
- Throws:
SecurityException
-
testWhitelistedAlgorithms
public void testWhitelistedAlgorithms() -
testBlacklistedSignatureAlgorithm
public void testBlacklistedSignatureAlgorithm() -
testBlacklistedDigestAlgorithm
public void testBlacklistedDigestAlgorithm() -
testRawGoodPathInAnchors
- Throws:
SecurityException
-
testRawGoodPathInCred
- Throws:
SecurityException
-
testRawGoodPathNoTrustedNames
- Throws:
SecurityException
-
testRawGoodPathBadTrustedName
- Throws:
SecurityException
-
testRawCertRevoked
- Throws:
SecurityException
-
testRawCertExpired
- Throws:
SecurityException
-
testRawCertMissingAnchor
- Throws:
SecurityException
-
testRawCertNoAnchors
- Throws:
SecurityException
-
testRawTamperedData
- Throws:
SecurityException
-
testRawNoCandidateCred
- Throws:
SecurityException
-
testRawWrongCredType
- Throws:
SecurityException
-
testRawWhitelistedAlgorithm
- Throws:
SecurityException
-
testRawBlacklistedAlgorithm
- Throws:
SecurityException
-
testValidateSuccess
-
testValidateFailure
-
getSignature
-
getCredential
private BasicX509Credential getCredential(String entityCertFileName, String entityKeyFileName, String... chainMembers) -
getEngine
@Nonnull private PKIXSignatureTrustEngine getEngine(Collection<X509Certificate> certs, Collection<X509CRL> crls, Integer depth, String... trustedNames) -
getPKIXInfoSet
@Nonnull private PKIXValidationInformation getPKIXInfoSet(Collection<X509Certificate> certs, Collection<X509CRL> crls, Integer depth) -
getCertificates
-
getPrivateKey
-
getCertificate
-
getCRLS
-
getCRL
-
getInputStream
-
buildSignedObject
@Nonnull private SignableXMLObject buildSignedObject(X509Credential signingX509Cred) throws SignatureException - Throws:
SignatureException
-
testRawValidateSuccess
-
testRawValidateFailure
-