1 package org.bouncycastle.x509; 2 3 import java.io.IOException; 4 import java.math.BigInteger; 5 import java.security.InvalidKeyException; 6 import java.security.NoSuchAlgorithmException; 7 import java.security.NoSuchProviderException; 8 import java.security.PublicKey; 9 import java.security.SignatureException; 10 import java.security.cert.CertificateException; 11 import java.security.cert.CertificateExpiredException; 12 import java.security.cert.CertificateNotYetValidException; 13 import java.security.cert.X509Extension; 14 import java.util.Date; 15 16 /** 17 * Interface for an X.509 Attribute Certificate. 18 * @deprecated use X509CertificateHolder class in the PKIX package. 19 */ 20 public interface X509AttributeCertificate 21 extends X509Extension 22 { 23 /** 24 * Return the version number for the certificate. 25 * 26 * @return the version number. 27 */ getVersion()28 public int getVersion(); 29 30 /** 31 * Return the serial number for the certificate. 32 * 33 * @return the serial number. 34 */ getSerialNumber()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 */ getNotBefore()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 */ getNotAfter()49 public Date getNotAfter(); 50 51 /** 52 * Return the holder of the certificate. 53 * 54 * @return the holder. 55 */ getHolder()56 public AttributeCertificateHolder getHolder(); 57 58 /** 59 * Return the issuer details for the certificate. 60 * 61 * @return the issuer details. 62 */ getIssuer()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 */ getAttributes()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 */ getAttributes(String oid)78 public X509Attribute[] getAttributes(String oid); 79 getIssuerUniqueID()80 public boolean[] getIssuerUniqueID(); 81 checkValidity()82 public void checkValidity() 83 throws CertificateExpiredException, CertificateNotYetValidException; 84 checkValidity(Date date)85 public void checkValidity(Date date) 86 throws CertificateExpiredException, CertificateNotYetValidException; 87 getSignature()88 public byte[] getSignature(); 89 verify(PublicKey key, String provider)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 */ getEncoded()100 public byte[] getEncoded() 101 throws IOException; 102 } 103