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

MyCertificate

public class MyCertificate extends Certificate implements X509Extension
Stub class for java.security.cert.Certificate tests

Fields Summary
private static final long
serialVersionUID
private final byte[]
encoding
public CertificateRep
rep
Constructors Summary
public MyCertificate(String type, byte[] encoding)
Constructs new object of class MyCertificate

param
type
param
encoding


                    
         
        super(type);
        // don't copy to allow null parameter in test
        this.encoding = encoding;
    
Methods Summary
public java.security.cert.Certificate$CertificateRepgetCertificateRep()

        Object obj = super.writeReplace();
        return (MyCertificateRep) obj;
    
public java.util.SetgetCriticalExtensionOIDs()

        return null;
    
public byte[]getEncoded()
Returns MyCertificate encoding

        // do copy to force NPE in test
        return encoding.clone();
    
public byte[]getExtensionValue(java.lang.String oid)

        return null;
    
public java.util.SetgetNonCriticalExtensionOIDs()

        return null;
    
public java.security.PublicKeygetPublicKey()
Returns public key (stub) from MyCertificate object

        return new PublicKey() {
           private static final long serialVersionUID = 788077928335589816L;
            public String getAlgorithm() {
                return "TEST";
            }
            public byte[] getEncoded() {
                return new byte[] {(byte)1, (byte)2, (byte)3};
            }
            public String getFormat() {
                return "TEST_FORMAT";
            }
        };
    
public booleanhasUnsupportedCriticalExtension()

        return false;
    
public java.lang.StringtoString()
Returns formatted String describing MyCertificate object

        return "[My test Certificate, type: " + getType() + "]";
    
public voidverify(java.security.PublicKey key)
Does nothing

    
public voidverify(java.security.PublicKey key, java.lang.String sigProvider)
Does nothing

    
public java.lang.ObjectwriteReplace()

        return super.writeReplace();