jdk/src/java.base/share/classes/java/security/Identity.java
changeset 30033 b9c86c17164a
parent 25859 3317bb8137f4
child 31695 4d10942c9a7b
equal deleted inserted replaced
30019:e7dbbef69d12 30033:b9c86c17164a
   183     /* Should we throw an exception if this is already set? */
   183     /* Should we throw an exception if this is already set? */
   184     public void setPublicKey(PublicKey key) throws KeyManagementException {
   184     public void setPublicKey(PublicKey key) throws KeyManagementException {
   185 
   185 
   186         check("setIdentityPublicKey");
   186         check("setIdentityPublicKey");
   187         this.publicKey = key;
   187         this.publicKey = key;
   188         certificates = new Vector<Certificate>();
   188         certificates = new Vector<>();
   189     }
   189     }
   190 
   190 
   191     /**
   191     /**
   192      * Specifies a general information string for this identity.
   192      * Specifies a general information string for this identity.
   193      *
   193      *
   246     throws KeyManagementException {
   246     throws KeyManagementException {
   247 
   247 
   248         check("addIdentityCertificate");
   248         check("addIdentityCertificate");
   249 
   249 
   250         if (certificates == null) {
   250         if (certificates == null) {
   251             certificates = new Vector<Certificate>();
   251             certificates = new Vector<>();
   252         }
   252         }
   253         if (publicKey != null) {
   253         if (publicKey != null) {
   254             if (!keyEquals(publicKey, certificate.getPublicKey())) {
   254             if (!keyEquals(publicKey, certificate.getPublicKey())) {
   255                 throw new KeyManagementException(
   255                 throw new KeyManagementException(
   256                     "public key different from cert public key");
   256                     "public key different from cert public key");