src/java.base/share/classes/java/security/cert/Certificate.java
changeset 58242 94bb65cb37d3
parent 57950 4612a3cfb927
child 58679 9c3209ff7550
equal deleted inserted replaced
58241:33de7752835c 58242:94bb65cb37d3
   146      * form of encoding; for example, X.509 certificates would
   146      * form of encoding; for example, X.509 certificates would
   147      * be encoded as ASN.1 DER.
   147      * be encoded as ASN.1 DER.
   148      *
   148      *
   149      * @return the encoded form of this certificate
   149      * @return the encoded form of this certificate
   150      *
   150      *
   151      * @exception CertificateEncodingException if an encoding error occurs.
   151      * @throws    CertificateEncodingException if an encoding error occurs.
   152      */
   152      */
   153     public abstract byte[] getEncoded()
   153     public abstract byte[] getEncoded()
   154         throws CertificateEncodingException;
   154         throws CertificateEncodingException;
   155 
   155 
   156     /**
   156     /**
   157      * Verifies that this certificate was signed using the
   157      * Verifies that this certificate was signed using the
   158      * private key that corresponds to the specified public key.
   158      * private key that corresponds to the specified public key.
   159      *
   159      *
   160      * @param key the PublicKey used to carry out the verification.
   160      * @param key the PublicKey used to carry out the verification.
   161      *
   161      *
   162      * @exception NoSuchAlgorithmException on unsupported signature
   162      * @throws    NoSuchAlgorithmException on unsupported signature
   163      * algorithms.
   163      * algorithms.
   164      * @exception InvalidKeyException on incorrect key.
   164      * @throws    InvalidKeyException on incorrect key.
   165      * @exception NoSuchProviderException if there's no default provider.
   165      * @throws    NoSuchProviderException if there's no default provider.
   166      * @exception SignatureException on signature errors.
   166      * @throws    SignatureException on signature errors.
   167      * @exception CertificateException on encoding errors.
   167      * @throws    CertificateException on encoding errors.
   168      */
   168      */
   169     public abstract void verify(PublicKey key)
   169     public abstract void verify(PublicKey key)
   170         throws CertificateException, NoSuchAlgorithmException,
   170         throws CertificateException, NoSuchAlgorithmException,
   171         InvalidKeyException, NoSuchProviderException,
   171         InvalidKeyException, NoSuchProviderException,
   172         SignatureException;
   172         SignatureException;
   178      * supplied by the specified provider.
   178      * supplied by the specified provider.
   179      *
   179      *
   180      * @param key the PublicKey used to carry out the verification.
   180      * @param key the PublicKey used to carry out the verification.
   181      * @param sigProvider the name of the signature provider.
   181      * @param sigProvider the name of the signature provider.
   182      *
   182      *
   183      * @exception NoSuchAlgorithmException on unsupported signature
   183      * @throws    NoSuchAlgorithmException on unsupported signature
   184      * algorithms.
   184      * algorithms.
   185      * @exception InvalidKeyException on incorrect key.
   185      * @throws    InvalidKeyException on incorrect key.
   186      * @exception NoSuchProviderException on incorrect provider.
   186      * @throws    NoSuchProviderException on incorrect provider.
   187      * @exception SignatureException on signature errors.
   187      * @throws    SignatureException on signature errors.
   188      * @exception CertificateException on encoding errors.
   188      * @throws    CertificateException on encoding errors.
   189      */
   189      */
   190     public abstract void verify(PublicKey key, String sigProvider)
   190     public abstract void verify(PublicKey key, String sigProvider)
   191         throws CertificateException, NoSuchAlgorithmException,
   191         throws CertificateException, NoSuchAlgorithmException,
   192         InvalidKeyException, NoSuchProviderException,
   192         InvalidKeyException, NoSuchProviderException,
   193         SignatureException;
   193         SignatureException;
   205      * and by default throws an {@code UnsupportedOperationException}.
   205      * and by default throws an {@code UnsupportedOperationException}.
   206      *
   206      *
   207      * @param key the PublicKey used to carry out the verification.
   207      * @param key the PublicKey used to carry out the verification.
   208      * @param sigProvider the signature provider.
   208      * @param sigProvider the signature provider.
   209      *
   209      *
   210      * @exception NoSuchAlgorithmException on unsupported signature
   210      * @throws    NoSuchAlgorithmException on unsupported signature
   211      * algorithms.
   211      * algorithms.
   212      * @exception InvalidKeyException on incorrect key.
   212      * @throws    InvalidKeyException on incorrect key.
   213      * @exception SignatureException on signature errors.
   213      * @throws    SignatureException on signature errors.
   214      * @exception CertificateException on encoding errors.
   214      * @throws    CertificateException on encoding errors.
   215      * @exception UnsupportedOperationException if the method is not supported
   215      * @throws    UnsupportedOperationException if the method is not supported
   216      * @since 1.8
   216      * @since 1.8
   217      */
   217      */
   218     public void verify(PublicKey key, Provider sigProvider)
   218     public void verify(PublicKey key, Provider sigProvider)
   219         throws CertificateException, NoSuchAlgorithmException,
   219         throws CertificateException, NoSuchAlgorithmException,
   220         InvalidKeyException, SignatureException {
   220         InvalidKeyException, SignatureException {