Class PKIXSignatureTrustEngineTest
- java.lang.Object
-
- org.opensaml.core.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.xml.XMLObjectBaseTestCase
-
- org.opensaml.xmlsec.signature.support.impl.PKIXSignatureTrustEngineTest
-
public class PKIXSignatureTrustEngineTest extends org.opensaml.core.xml.XMLObjectBaseTestCaseTests thePKIXSignatureTrustEngineimplementation.
-
-
Field Summary
Fields Modifier and Type Field Description private net.shibboleth.utilities.java.support.resolver.CriteriaSetcriteriaSetprivate static StringDATA_PATHprivate booleanemitKeyInfoprivate booleanemitKeyValueOnlyprivate static Set<X509Certificate>EMPTY_ANCHORSprivate static Set<X509CRL>EMPTY_CRLSprivate org.opensaml.xmlsec.signature.support.impl.PKIXSignatureTrustEngineengineprivate static IntegerMAX_DEPTHprivate StringrawAlgorithmURIprivate org.opensaml.security.credential.CredentialrawCandidateCredprivate StringrawDataprivate byte[]rawSignatureprivate byte[]rawSignedContentprivate org.opensaml.xmlsec.signature.Signaturesignatureprivate StringsubjectCNprivate booleantamperDocumentPostSigning
-
Constructor Summary
Constructors Constructor Description PKIXSignatureTrustEngineTest()
-
Method Summary
-
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
-
DATA_PATH
private static final String DATA_PATH
- See Also:
- Constant Field Values
-
EMPTY_ANCHORS
private static final Set<X509Certificate> EMPTY_ANCHORS
-
MAX_DEPTH
private static final Integer MAX_DEPTH
-
engine
private org.opensaml.xmlsec.signature.support.impl.PKIXSignatureTrustEngine engine
-
signature
private org.opensaml.xmlsec.signature.Signature signature
-
criteriaSet
private net.shibboleth.utilities.java.support.resolver.CriteriaSet criteriaSet
-
subjectCN
private String subjectCN
-
tamperDocumentPostSigning
private boolean tamperDocumentPostSigning
-
emitKeyInfo
private boolean emitKeyInfo
-
emitKeyValueOnly
private boolean emitKeyValueOnly
-
rawData
private String rawData
-
rawSignedContent
private byte[] rawSignedContent
-
rawAlgorithmURI
private String rawAlgorithmURI
-
rawSignature
private byte[] rawSignature
-
rawCandidateCred
private org.opensaml.security.credential.Credential rawCandidateCred
-
-
Method Detail
-
setUp
@BeforeMethod protected void setUp() throws Exception
- 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
public void testTamperedData() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testNoCandidateCred
public void testNoCandidateCred() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testWrongCredType
public void testWrongCredType() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testWhitelistedAlgorithms
public void testWhitelistedAlgorithms()
-
testBlacklistedSignatureAlgorithm
public void testBlacklistedSignatureAlgorithm()
-
testBlacklistedDigestAlgorithm
public void testBlacklistedDigestAlgorithm()
-
testRawGoodPathInAnchors
public void testRawGoodPathInAnchors() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testRawGoodPathInCred
public void testRawGoodPathInCred() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testRawGoodPathNoTrustedNames
public void testRawGoodPathNoTrustedNames() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testRawGoodPathBadTrustedName
public void testRawGoodPathBadTrustedName() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testRawCertRevoked
public void testRawCertRevoked() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testRawCertExpired
public void testRawCertExpired() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testRawCertMissingAnchor
public void testRawCertMissingAnchor() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testRawCertNoAnchors
public void testRawCertNoAnchors() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testRawTamperedData
public void testRawTamperedData() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testRawNoCandidateCred
public void testRawNoCandidateCred() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testRawWrongCredType
public void testRawWrongCredType() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testRawWhitelistedAlgorithm
public void testRawWhitelistedAlgorithm() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testRawBlacklistedAlgorithm
public void testRawBlacklistedAlgorithm() throws org.opensaml.security.SecurityException- Throws:
org.opensaml.security.SecurityException
-
testValidateSuccess
private void testValidateSuccess(String message)
-
testValidateFailure
private void testValidateFailure(String message)
-
getSignature
private org.opensaml.xmlsec.signature.Signature getSignature(String entityCertFileName, String entityKeyFileName, String... chainMembers)
-
getCredential
private org.opensaml.security.x509.BasicX509Credential getCredential(String entityCertFileName, String entityKeyFileName, String... chainMembers)
-
getEngine
private org.opensaml.xmlsec.signature.support.impl.PKIXSignatureTrustEngine getEngine(Collection<X509Certificate> certs, Collection<X509CRL> crls, Integer depth, String... trustedNames)
-
getPKIXInfoSet
private org.opensaml.security.x509.PKIXValidationInformation getPKIXInfoSet(Collection<X509Certificate> certs, Collection<X509CRL> crls, Integer depth)
-
getCertificates
private Collection<X509Certificate> getCertificates(String... certNames)
-
getPrivateKey
private PrivateKey getPrivateKey(String fileName)
-
getCertificate
private X509Certificate getCertificate(String fileName)
-
getCRLS
private Collection<X509CRL> getCRLS(String... crlNames)
-
getInputStream
private InputStream getInputStream(String fileName)
-
buildSignedObject
private org.opensaml.xmlsec.signature.SignableXMLObject buildSignedObject(org.opensaml.security.x509.X509Credential signingX509Cred) throws org.opensaml.xmlsec.signature.support.SignatureException- Throws:
org.opensaml.xmlsec.signature.support.SignatureException
-
testRawValidateSuccess
private void testRawValidateSuccess(String message)
-
testRawValidateFailure
private void testRawValidateFailure(String message)
-
-