src/java.base/share/classes/java/security/KeyStore.java

Print this page
rev 10521 : 8055723[core]: Replace concat String to append in StringBuilder parameters
Contributed-by: Otavio Santana <otaviojava@java.net>


 593 
 594         /**
 595          * Retrieves the attributes associated with an entry.
 596          * <p>
 597          *
 598          * @return an unmodifiable {@code Set} of attributes, possibly empty
 599          *
 600          * @since 1.8
 601          */
 602         @Override
 603         public Set<Attribute> getAttributes() {
 604             return attributes;
 605         }
 606 
 607         /**
 608          * Returns a string representation of this PrivateKeyEntry.
 609          * @return a string representation of this PrivateKeyEntry.
 610          */
 611         public String toString() {
 612             StringBuilder sb = new StringBuilder();
 613             sb.append("Private key entry and certificate chain with "
 614                 + chain.length + " elements:\r\n");
 615             for (Certificate cert : chain) {
 616                 sb.append(cert);
 617                 sb.append("\r\n");
 618             }
 619             return sb.toString();
 620         }
 621 
 622     }
 623 
 624     /**
 625      * A {@code KeyStore} entry that holds a {@code SecretKey}.
 626      *
 627      * @since 1.5
 628      */
 629     public static final class SecretKeyEntry implements Entry {
 630 
 631         private final SecretKey sKey;
 632         private final Set<Attribute> attributes;
 633 
 634         /**




 593 
 594         /**
 595          * Retrieves the attributes associated with an entry.
 596          * <p>
 597          *
 598          * @return an unmodifiable {@code Set} of attributes, possibly empty
 599          *
 600          * @since 1.8
 601          */
 602         @Override
 603         public Set<Attribute> getAttributes() {
 604             return attributes;
 605         }
 606 
 607         /**
 608          * Returns a string representation of this PrivateKeyEntry.
 609          * @return a string representation of this PrivateKeyEntry.
 610          */
 611         public String toString() {
 612             StringBuilder sb = new StringBuilder();
 613             sb.append("Private key entry and certificate chain with ")
 614                     .append(chain.length).append(" elements:\r\n");
 615             for (Certificate cert : chain) {
 616                 sb.append(cert);
 617                 sb.append("\r\n");
 618             }
 619             return sb.toString();
 620         }
 621 
 622     }
 623 
 624     /**
 625      * A {@code KeyStore} entry that holds a {@code SecretKey}.
 626      *
 627      * @since 1.5
 628      */
 629     public static final class SecretKeyEntry implements Entry {
 630 
 631         private final SecretKey sKey;
 632         private final Set<Attribute> attributes;
 633 
 634         /**