001: package org.bouncycastle.x509;
002:
003: import java.io.IOException;
004: import java.math.BigInteger;
005: import java.security.InvalidKeyException;
006: import java.security.NoSuchAlgorithmException;
007: import java.security.NoSuchProviderException;
008: import java.security.PublicKey;
009: import java.security.SignatureException;
010: import java.security.cert.CertificateException;
011: import java.security.cert.CertificateExpiredException;
012: import java.security.cert.CertificateNotYetValidException;
013: import java.security.cert.X509Extension;
014: import java.util.Date;
015:
016: /**
017: * Interface for an X.509 Attribute Certificate.
018: */
019: public interface X509AttributeCertificate extends X509Extension {
020: /**
021: * Return the version number for the certificate.
022: *
023: * @return the version number.
024: */
025: public int getVersion();
026:
027: /**
028: * Return the serial number for the certificate.
029: *
030: * @return the serial number.
031: */
032: public BigInteger getSerialNumber();
033:
034: /**
035: * Return the date before which the certificate is not valid.
036: *
037: * @return the "not valid before" date.
038: */
039: public Date getNotBefore();
040:
041: /**
042: * Return the date after which the certificate is not valid.
043: *
044: * @return the "not valid afer" date.
045: */
046: public Date getNotAfter();
047:
048: /**
049: * Return the holder of the certificate.
050: *
051: * @return the holder.
052: */
053: public AttributeCertificateHolder getHolder();
054:
055: /**
056: * Return the issuer details for the certificate.
057: *
058: * @return the issuer details.
059: */
060: public AttributeCertificateIssuer getIssuer();
061:
062: /**
063: * Return the attributes contained in the attribute block in the certificate.
064: *
065: * @return an array of attributes.
066: */
067: public X509Attribute[] getAttributes();
068:
069: /**
070: * Return the attributes with the same type as the passed in oid.
071: *
072: * @param oid the object identifier we wish to match.
073: * @return an array of matched attributes, null if there is no match.
074: */
075: public X509Attribute[] getAttributes(String oid);
076:
077: public boolean[] getIssuerUniqueID();
078:
079: public void checkValidity() throws CertificateExpiredException,
080: CertificateNotYetValidException;
081:
082: public void checkValidity(Date date)
083: throws CertificateExpiredException,
084: CertificateNotYetValidException;
085:
086: public byte[] getSignature();
087:
088: public void verify(PublicKey key, String provider)
089: throws CertificateException, NoSuchAlgorithmException,
090: InvalidKeyException, NoSuchProviderException,
091: SignatureException;
092:
093: /**
094: * Return an ASN.1 encoded byte array representing the attribute certificate.
095: *
096: * @return an ASN.1 encoded byte array.
097: * @throws IOException if the certificate cannot be encoded.
098: */
099: public byte[] getEncoded() throws IOException;
100: }
|