Class ExplicitKeySignatureTrustEngineTest
- java.lang.Object
-
- org.opensaml.core.OpenSAMLInitBaseTestCase
-
- org.opensaml.core.xml.XMLObjectBaseTestCase
-
- org.opensaml.xmlsec.signature.support.impl.ExplicitKeySignatureTrustEngineTest
-
public class ExplicitKeySignatureTrustEngineTest extends XMLObjectBaseTestCase
Test explicit key signature trust engine.
-
-
Field Summary
Fields Modifier and Type Field Description private CollectionCredentialResolvercredResolverprivate CriteriaSetcriteriaSetprivate ExplicitKeySignatureTrustEngineengineprivate X509CertificateotherCert1private StringotherCert1Base64private StringrawAlgorithmURIprivate byte[]rawControlSignatureprivate StringrawDataprivate X509CertificatesigningCertprivate StringsigningCertBase64private StringsigningEntityIDprivate PrivateKeysigningPrivateKeyprivate StringsigningPrivateKeyBase64private BasicX509CredentialsigningX509Credprivate List<Credential>trustedCredentials-
Fields inherited from class org.opensaml.core.xml.XMLObjectBaseTestCase
builderFactory, marshallerFactory, parserPool, simpleXMLObjectQName, unmarshallerFactory
-
-
Constructor Summary
Constructors Constructor Description ExplicitKeySignatureTrustEngineTest()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SignableXMLObjectbuildSignedObject()Build a signed object.protected SignableXMLObjectgetInvalidSignedObject()Get a signed object containing the signature to be validated.protected SignableXMLObjectgetValidSignedObject()Get a signed object containing the signature to be validated.protected voidsetUp()voidtestBlacklistedDigestAlgorithm()Test blacklisted digest method algorithm URI.voidtestBlacklistedSignatureAlgorithm()Test blacklisted signature method algorithm URI.voidtestInvalidSignature()Test invalid signature, trusted signing credential.voidtestRawBlacklistedAlgorithm()Test valid raw signature with whitelisted signature algorithm.voidtestRawInvalidSignature()Test invalid raw signature, trusted signing credential.voidtestRawSuccess()Test valid raw signature, trusted signing credential.voidtestRawUntrustedCredential()Test valid raw signature, untrusted signing credential.voidtestRawWhitelistedAlgorithm()Test valid raw signature with whitelisted signature algorithm.voidtestSuccess()Test valid signature.voidtestUntrustedCredential()Test valid signature, untrusted signing credential.voidtestWhitelistedAlgorithms()Test whitelisted signature and digest method algorithm URIs.-
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
-
signingCert
private X509Certificate signingCert
-
signingCertBase64
private String signingCertBase64
-
signingPrivateKey
private PrivateKey signingPrivateKey
-
signingPrivateKeyBase64
private String signingPrivateKeyBase64
-
otherCert1
private X509Certificate otherCert1
-
otherCert1Base64
private String otherCert1Base64
-
credResolver
private CollectionCredentialResolver credResolver
-
trustedCredentials
private List<Credential> trustedCredentials
-
signingX509Cred
private BasicX509Credential signingX509Cred
-
engine
private ExplicitKeySignatureTrustEngine engine
-
criteriaSet
private CriteriaSet criteriaSet
-
signingEntityID
private String signingEntityID
-
rawAlgorithmURI
private String rawAlgorithmURI
-
rawData
private String rawData
-
rawControlSignature
private byte[] rawControlSignature
-
-
Method Detail
-
setUp
@BeforeMethod protected void setUp() throws Exception
- Throws:
Exception
-
testSuccess
public void testSuccess() throws SecurityExceptionTest valid signature.- Throws:
SecurityException- ...
-
testUntrustedCredential
public void testUntrustedCredential() throws SecurityExceptionTest valid signature, untrusted signing credential.- Throws:
SecurityException- ...
-
testInvalidSignature
public void testInvalidSignature() throws SecurityExceptionTest invalid signature, trusted signing credential.- Throws:
SecurityException- ...
-
testWhitelistedAlgorithms
public void testWhitelistedAlgorithms() throws SecurityExceptionTest whitelisted signature and digest method algorithm URIs.- Throws:
SecurityException- ...
-
testBlacklistedSignatureAlgorithm
public void testBlacklistedSignatureAlgorithm() throws SecurityExceptionTest blacklisted signature method algorithm URI.- Throws:
SecurityException- ...
-
testBlacklistedDigestAlgorithm
public void testBlacklistedDigestAlgorithm() throws SecurityExceptionTest blacklisted digest method algorithm URI.- Throws:
SecurityException- ...
-
testRawSuccess
public void testRawSuccess() throws SecurityExceptionTest valid raw signature, trusted signing credential.- Throws:
SecurityException- ...
-
testRawUntrustedCredential
public void testRawUntrustedCredential() throws SecurityExceptionTest valid raw signature, untrusted signing credential.- Throws:
SecurityException- ...
-
testRawInvalidSignature
public void testRawInvalidSignature() throws SecurityExceptionTest invalid raw signature, trusted signing credential.- Throws:
SecurityException- ...
-
testRawWhitelistedAlgorithm
public void testRawWhitelistedAlgorithm() throws SecurityExceptionTest valid raw signature with whitelisted signature algorithm.- Throws:
SecurityException- ...
-
testRawBlacklistedAlgorithm
public void testRawBlacklistedAlgorithm() throws SecurityExceptionTest valid raw signature with whitelisted signature algorithm.- Throws:
SecurityException- ...
-
getValidSignedObject
protected SignableXMLObject getValidSignedObject()
Get a signed object containing the signature to be validated.- Returns:
- a signed object
-
getInvalidSignedObject
protected SignableXMLObject getInvalidSignedObject()
Get a signed object containing the signature to be validated. Signature should be invalid when valid (i.e. signed content modified, etc ).- Returns:
- a signed object, with invalid signature
-
buildSignedObject
protected SignableXMLObject buildSignedObject() throws SignatureException
Build a signed object.- Returns:
- a signed object
- Throws:
SignatureException- ...
-
-