FileDocCategorySizeDatePackage
MyCertPath.javaAPI DocAndroid 1.5 API4266Wed May 06 22:41:06 BST 2009org.apache.harmony.security.tests.support.cert

MyCertPath

public class MyCertPath extends CertPath
Stub class for java.security.cert.CertPath tests

Fields Summary
private static final long
serialVersionUID
private final Vector
certificates
my certificates list
private final Vector
encodingNames
List of encodings supported
private final byte[]
encoding
my cert path the only encoding
Constructors Summary
public MyCertPath(byte[] encoding)
Constructs new instance of MyCertPath


               
       
        super("MyEncoding");
        this.encoding = encoding;
        certificates = new Vector<MyCertificate>();
        certificates.add(new MyCertificate("MyEncoding", encoding));
        encodingNames = new Vector<String>();
        encodingNames.add("MyEncoding");
    
Methods Summary
public java.util.ListgetCertificates()

return
certificates list
see
java.security.cert.CertPath#getCertificates()

        return Collections.unmodifiableList(certificates);
    
public byte[]getEncoded()

return
default encoded form of this cert path
throws
CertificateEncodingException
see
java.security.cert.CertPath#getEncoded()

        return encoding.clone();
    
public byte[]getEncoded(java.lang.String encoding)

return
encoded form of this cert path as specified by encoding parameter
throws
CertificateEncodingException if encoding not equals "MyEncoding"
see
java.security.cert.CertPath#getEncoded(java.lang.String)

        if (getType().equals(encoding)) {
            return this.encoding.clone();
        }
        throw new CertificateEncodingException("Encoding not supported: " +
                encoding);
    
public java.util.IteratorgetEncodings()

return
iterator through encodings supported
see
java.security.cert.CertPath#getEncodings()

        return Collections.unmodifiableCollection(encodingNames).iterator();
    
public java.lang.ObjectwriteReplace()

return
the CertPathRep to be serialized
see
java.security.cert.CertPath#writeReplace()

        return super.writeReplace();