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 XMLObjectBaseTestCase
Tests thePKIXSignatureTrustEngineimplementation.
-
-
Field Summary
Fields Modifier and Type Field Description private CriteriaSetcriteriaSetprivate static StringDATA_PATHprivate booleanemitKeyInfoprivate booleanemitKeyValueOnlyprivate static Set<X509Certificate>EMPTY_ANCHORSprivate static Set<X509CRL>EMPTY_CRLSprivate PKIXSignatureTrustEngineengineprivate static IntegerMAX_DEPTHprivate StringrawAlgorithmURIprivate CredentialrawCandidateCredprivate StringrawDataprivate byte[]rawSignatureprivate byte[]rawSignedContentprivate Signaturesignatureprivate StringsubjectCNprivate booleantamperDocumentPostSigning-
Fields inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase
builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory
-
-
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
-
Methods inherited from class org.opensaml.core.OpenSAMLInitBaseTestCase
initOpenSAML
-
-
-
-
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 PKIXSignatureTrustEngine engine
-
signature
private Signature signature
-
criteriaSet
private 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 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 SecurityException- Throws:
SecurityException
-
testNoCandidateCred
public void testNoCandidateCred() throws SecurityException- Throws:
SecurityException
-
testWrongCredType
public void testWrongCredType() throws SecurityException- Throws:
SecurityException
-
testWhitelistedAlgorithms
public void testWhitelistedAlgorithms()
-
testBlacklistedSignatureAlgorithm
public void testBlacklistedSignatureAlgorithm()
-
testBlacklistedDigestAlgorithm
public void testBlacklistedDigestAlgorithm()
-
testRawGoodPathInAnchors
public void testRawGoodPathInAnchors() throws SecurityException- Throws:
SecurityException
-
testRawGoodPathInCred
public void testRawGoodPathInCred() throws SecurityException- Throws:
SecurityException
-
testRawGoodPathNoTrustedNames
public void testRawGoodPathNoTrustedNames() throws SecurityException- Throws:
SecurityException
-
testRawGoodPathBadTrustedName
public void testRawGoodPathBadTrustedName() throws SecurityException- Throws:
SecurityException
-
testRawCertRevoked
public void testRawCertRevoked() throws SecurityException- Throws:
SecurityException
-
testRawCertExpired
public void testRawCertExpired() throws SecurityException- Throws:
SecurityException
-
testRawCertMissingAnchor
public void testRawCertMissingAnchor() throws SecurityException- Throws:
SecurityException
-
testRawCertNoAnchors
public void testRawCertNoAnchors() throws SecurityException- Throws:
SecurityException
-
testRawTamperedData
public void testRawTamperedData() throws SecurityException- Throws:
SecurityException
-
testRawNoCandidateCred
public void testRawNoCandidateCred() throws SecurityException- Throws:
SecurityException
-
testRawWrongCredType
public void testRawWrongCredType() throws SecurityException- Throws:
SecurityException
-
testRawWhitelistedAlgorithm
public void testRawWhitelistedAlgorithm() throws SecurityException- Throws:
SecurityException
-
testRawBlacklistedAlgorithm
public void testRawBlacklistedAlgorithm() throws SecurityException- Throws:
SecurityException
-
testValidateSuccess
private void testValidateSuccess(String message)
-
testValidateFailure
private void testValidateFailure(String message)
-
getSignature
private Signature getSignature(String entityCertFileName, String entityKeyFileName, String... chainMembers)
-
getCredential
private BasicX509Credential getCredential(String entityCertFileName, String entityKeyFileName, String... chainMembers)
-
getEngine
private PKIXSignatureTrustEngine getEngine(Collection<X509Certificate> certs, Collection<X509CRL> crls, Integer depth, String... trustedNames)
-
getPKIXInfoSet
private 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 SignableXMLObject buildSignedObject(X509Credential signingX509Cred) throws SignatureException
- Throws:
SignatureException
-
testRawValidateSuccess
private void testRawValidateSuccess(String message)
-
testRawValidateFailure
private void testRawValidateFailure(String message)
-
-