public class PKIXSignatureTrustEngine extends BaseSignatureTrustEngine<Pair<Set<String>,Iterable<PKIXValidationInformation>>> implements PKIXTrustEngine<Signature>
SignatureTrustEngine
which evaluates the validity and trustworthiness of XML and raw
signatures.
Processing is performed as described in BaseSignatureTrustEngine
. If based on this processing, it is
determined that the Signature's KeyInfo is not present or does not contain a valid (and trusted) signing key, then
trust engine validation fails. Since the PKIX engine is based on the assumption that trusted signing keys are not
known in advance, the signing key must be present in, or derivable from, the information in the Signature's KeyInfo
element.
コンストラクタと説明 |
---|
PKIXSignatureTrustEngine(PKIXValidationInformationResolver resolver,
KeyInfoCredentialResolver keyInfoResolver)
Constructor.
|
PKIXSignatureTrustEngine(PKIXValidationInformationResolver resolver,
KeyInfoCredentialResolver keyInfoResolver,
PKIXTrustEvaluator pkixEvaluator,
X509CredentialNameEvaluator nameEvaluator)
Constructor.
|
修飾子とタイプ | メソッドと説明 |
---|---|
protected boolean |
checkNames(Set<String> trustedNames,
X509Credential untrustedCredential)
Evaluate the credential against the set of trusted names.
|
protected boolean |
evaluateTrust(Credential untrustedCredential,
Pair<Set<String>,Iterable<PKIXValidationInformation>> validationPair)
Evaluate the untrusted KeyInfo-derived credential with respect to the specified trusted information.
|
PKIXValidationInformationResolver |
getPKIXResolver()
Get the resolver instance which will be used to resolve PKIX validation information.
|
PKIXTrustEvaluator |
getPKIXTrustEvaluator()
Get the PKIXTrustEvaluator instance used to evalute trust.
|
X509CredentialNameEvaluator |
getX509CredentialNameEvaluator()
Get the X509CredentialNameEvaluator instance used to evalute a credential
against trusted names.
|
protected Pair<Set<String>,Iterable<PKIXValidationInformation>> |
resolveValidationInfo(CriteriaSet trustBasisCriteria)
Resolve and return a set of trusted validation information.
|
boolean |
validate(byte[] signature,
byte[] content,
String algorithmURI,
CriteriaSet trustBasisCriteria,
Credential candidateCredential)
Determines whether a raw signature over specified content is valid and signed by a trusted credential.
|
boolean |
validate(Signature signature,
CriteriaSet trustBasisCriteria)
Validates the token against trusted information obtained in an
implementation-specific manner.
|
checkParams, checkParamsRaw, getKeyInfoResolver, validate, verifySignature
public PKIXSignatureTrustEngine(PKIXValidationInformationResolver resolver, KeyInfoCredentialResolver keyInfoResolver)
The PKIX trust evaluator used defaults to CertPathPKIXTrustEvaluator
.
The X.509 credential name evaluator used defaults to BasicX509CredentialNameEvaluator
.
resolver
- credential resolver used to resolve trusted credentials.keyInfoResolver
- KeyInfo credential resolver used to obtain the (advisory) signing credential from a
Signature's KeyInfo element.public PKIXSignatureTrustEngine(PKIXValidationInformationResolver resolver, KeyInfoCredentialResolver keyInfoResolver, PKIXTrustEvaluator pkixEvaluator, X509CredentialNameEvaluator nameEvaluator)
resolver
- credential resolver used to resolve trusted credentials.keyInfoResolver
- KeyInfo credential resolver used to obtain the (advisory) signing credential from a
Signature's KeyInfo element.
* @param pkixEvaluator the PKIX trust evaluator to usenameEvaluator
- the X.509 credential name evaluator to use (may be null)public PKIXTrustEvaluator getPKIXTrustEvaluator()
The parameters of this evaluator may be modified to adjust trust evaluation processing.
public X509CredentialNameEvaluator getX509CredentialNameEvaluator()
The parameters of this evaluator may be modified to adjust trust evaluation processing.
public PKIXValidationInformationResolver getPKIXResolver()
getPKIXResolver
インタフェース内 PKIXTrustEngine<Signature>
public boolean validate(Signature signature, CriteriaSet trustBasisCriteria) throws SecurityException
validate
インタフェース内 TrustEngine<Signature>
signature
- security token to validatetrustBasisCriteria
- criteria used to describe and/or resolve the information
which serves as the basis for trust evaluationSecurityException
- thrown if there is a problem validating the security tokenpublic boolean validate(byte[] signature, byte[] content, String algorithmURI, CriteriaSet trustBasisCriteria, Credential candidateCredential) throws SecurityException
A candidate verification credential may optionally be supplied. If one is supplied and is determined to successfully verify the signature, an attempt will be made to establish trust on this basis.
If a candidate credential is not supplied, or it does not successfully verify the signature, some implementations may be able to resolve candidate verification credential(s) in an implementation-specific manner based on the trusted criteria supplied, and then attempt to verify the signature and establish trust on this basis.
validate
インタフェース内 SignatureTrustEngine
signature
- the signature valuecontent
- the content that was signedalgorithmURI
- the signature algorithm URI which was used to sign the contenttrustBasisCriteria
- criteria used to describe and/or resolve the information
which serves as the basis for trust evaluationcandidateCredential
- the untrusted candidate credential containing the validation key
for the signature (optional)SecurityException
- thrown if there is a problem attempting to verify the signature such as the signature
algorithim not being supportedprotected boolean evaluateTrust(Credential untrustedCredential, Pair<Set<String>,Iterable<PKIXValidationInformation>> validationPair) throws SecurityException
evaluateTrust
クラス内 BaseSignatureTrustEngine<Pair<Set<String>,Iterable<PKIXValidationInformation>>>
untrustedCredential
- the untrusted credential being evaluatedvalidationPair
- the information which serves as the basis for trust evaluationSecurityException
- if an error occurs during trust processingprotected Pair<Set<String>,Iterable<PKIXValidationInformation>> resolveValidationInfo(CriteriaSet trustBasisCriteria) throws SecurityException
trustBasisCriteria
- criteria used to describe and/or resolve the information which serves as the basis for
trust evaluationSecurityException
- thrown if there is an error resolving the information from the trusted resolverprotected boolean checkNames(Set<String> trustedNames, X509Credential untrustedCredential) throws SecurityException
Evaluates to true if no intsance of X509CredentialNameEvaluator
is configured.
trustedNames
- set of trusted namesuntrustedCredential
- the credential being evaluatedSecurityException
- thrown if there is an error evaluation the credentialCopyright © 2012. All Rights Reserved.