1package org.bouncycastle.x509;
2
3import java.io.IOException;
4import java.math.BigInteger;
5import java.security.InvalidKeyException;
6import java.security.NoSuchAlgorithmException;
7import java.security.NoSuchProviderException;
8import java.security.PublicKey;
9import java.security.SignatureException;
10import java.security.cert.CertificateException;
11import java.security.cert.CertificateExpiredException;
12import java.security.cert.CertificateNotYetValidException;
13import java.security.cert.X509Extension;
14import java.util.Date;
15
16/**
17 * Interface for an X.509 Attribute Certificate.
18 * @deprecated use X509CertificateHolder class in the PKIX package.
19 */
20public interface X509AttributeCertificate
21    extends X509Extension
22{
23    /**
24     * Return the version number for the certificate.
25     *
26     * @return the version number.
27     */
28    public int getVersion();
29
30    /**
31     * Return the serial number for the certificate.
32     *
33     * @return the serial number.
34     */
35    public BigInteger getSerialNumber();
36
37    /**
38     * Return the date before which the certificate is not valid.
39     *
40     * @return the "not valid before" date.
41     */
42    public Date getNotBefore();
43
44    /**
45     * Return the date after which the certificate is not valid.
46     *
47     * @return the "not valid afer" date.
48     */
49    public Date getNotAfter();
50
51    /**
52     * Return the holder of the certificate.
53     *
54     * @return the holder.
55     */
56    public AttributeCertificateHolder getHolder();
57
58    /**
59     * Return the issuer details for the certificate.
60     *
61     * @return the issuer details.
62     */
63    public AttributeCertificateIssuer getIssuer();
64
65    /**
66     * Return the attributes contained in the attribute block in the certificate.
67     *
68     * @return an array of attributes.
69     */
70    public X509Attribute[] getAttributes();
71
72    /**
73     * Return the attributes with the same type as the passed in oid.
74     *
75     * @param oid the object identifier we wish to match.
76     * @return an array of matched attributes, null if there is no match.
77     */
78    public X509Attribute[] getAttributes(String oid);
79
80    public boolean[] getIssuerUniqueID();
81
82    public void checkValidity()
83        throws CertificateExpiredException, CertificateNotYetValidException;
84
85    public void checkValidity(Date date)
86        throws CertificateExpiredException, CertificateNotYetValidException;
87
88    public byte[] getSignature();
89
90    public void verify(PublicKey key, String provider)
91            throws CertificateException, NoSuchAlgorithmException,
92            InvalidKeyException, NoSuchProviderException, SignatureException;
93
94    /**
95     * Return an ASN.1 encoded byte array representing the attribute certificate.
96     *
97     * @return an ASN.1 encoded byte array.
98     * @throws IOException if the certificate cannot be encoded.
99     */
100    public byte[] getEncoded()
101        throws IOException;
102}
103