FileDocCategorySizeDatePackage
PKIXCertPathValidatorResult.javaAPI DocAndroid 1.5 API4699Wed May 06 22:41:06 BST 2009java.security.cert

PKIXCertPathValidatorResult

public class PKIXCertPathValidatorResult extends Object implements CertPathValidatorResult
The implementation of the result of the PKIX certification path validation.
see
CertPathValidator
see
CertPathValidator#validate(CertPath, CertPathParameters)
since
Android 1.0

Fields Summary
private final TrustAnchor
trustAnchor
private final PolicyNode
policyTree
private final PublicKey
subjectPublicKey
Constructors Summary
public PKIXCertPathValidatorResult(TrustAnchor trustAnchor, PolicyNode policyTree, PublicKey subjectPublicKey)
Creates a new {@code PKIXCertPathValidatorResult} with the specified trust anchor, the valid policy tree and the subject public key.

param
trustAnchor the trust anchor describing the certification authority (CA) that served as trust anchor for the certification path.
param
policyTree the valid policy tree from the validation.
param
subjectPublicKey the subject public key from the validation.
since
Android 1.0

        this.trustAnchor = trustAnchor;
        this.policyTree = policyTree;
        this.subjectPublicKey = subjectPublicKey;
        if (this.trustAnchor == null) {
            throw new NullPointerException(Messages.getString("security.64")); //$NON-NLS-1$
        }
        if (this.subjectPublicKey == null) {
            throw new NullPointerException(
                    Messages.getString("security.65")); //$NON-NLS-1$
        }
    
Methods Summary
public java.lang.Objectclone()
Clones this {@code PKIXCertPathValidatorResult} instance.

return
the cloned instance.
since
Android 1.0

        try {
            return super.clone();
        } catch (CloneNotSupportedException e) {
            // Actually, the exception will not be thrown out.
            throw new Error(e);
        }
    
public java.security.cert.PolicyNodegetPolicyTree()
Returns the valid policy tree from the validation.

return
the valid policy tree from the validation.
since
Android 1.0

        return policyTree;
    
public java.security.PublicKeygetPublicKey()
Returns the subject public key from the validation.

return
the subject public key from the validation.
since
Android 1.0

        return subjectPublicKey;
    
public java.security.cert.TrustAnchorgetTrustAnchor()
Returns the trust anchor describing the certification authority (CA) that served as trust anchor for this certification path.

return
the trust anchor.
since
Android 1.0

        return trustAnchor;
    
public java.lang.StringtoString()
Returns a string representation for this {@code PKIXCertPathValidatorResult} instance.

return
a string representation for this {@code PKIXCertPathValidatorResult} instance.
since
Android 1.0

        StringBuffer sb = new StringBuffer(super.toString());
        sb.append(": [\n Trust Anchor: "); //$NON-NLS-1$
        sb.append(trustAnchor.toString());
        sb.append("\n Policy Tree: "); //$NON-NLS-1$
        sb.append(policyTree == null ? "no valid policy tree\n" //$NON-NLS-1$
                                     : policyTree.toString());
        sb.append("\n Subject Public Key: "); //$NON-NLS-1$
        sb.append(subjectPublicKey.toString());
        sb.append("\n]"); //$NON-NLS-1$
        return sb.toString();