src/java.base/share/classes/com/sun/crypto/provider/GCMParameters.java

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


 119         DerOutputStream out = new DerOutputStream();
 120         DerOutputStream bytes = new DerOutputStream();
 121 
 122         bytes.putOctetString(iv);
 123         bytes.putInteger(tLen);
 124         out.write(DerValue.tag_Sequence, bytes);
 125         return out.toByteArray();
 126     }
 127 
 128     protected byte[] engineGetEncoded(String encodingMethod)
 129         throws IOException {
 130         return engineGetEncoded();
 131     }
 132 
 133     /*
 134      * Returns a formatted string describing the parameters.
 135      */
 136     protected String engineToString() {
 137         String LINE_SEP = System.getProperty("line.separator");
 138         HexDumpEncoder encoder = new HexDumpEncoder();
 139         StringBuilder sb
 140             = new StringBuilder(LINE_SEP + "    iv:" + LINE_SEP + "["
 141                 + encoder.encodeBuffer(iv) + "]");
 142 
 143         sb.append(LINE_SEP + "tLen(bits):" + LINE_SEP + tLen*8 + LINE_SEP);
 144         return sb.toString();
 145     }
 146 }


 119         DerOutputStream out = new DerOutputStream();
 120         DerOutputStream bytes = new DerOutputStream();
 121 
 122         bytes.putOctetString(iv);
 123         bytes.putInteger(tLen);
 124         out.write(DerValue.tag_Sequence, bytes);
 125         return out.toByteArray();
 126     }
 127 
 128     protected byte[] engineGetEncoded(String encodingMethod)
 129         throws IOException {
 130         return engineGetEncoded();
 131     }
 132 
 133     /*
 134      * Returns a formatted string describing the parameters.
 135      */
 136     protected String engineToString() {
 137         String LINE_SEP = System.getProperty("line.separator");
 138         HexDumpEncoder encoder = new HexDumpEncoder();
 139         StringBuilder sb = new StringBuilder();
 140         sb.append(LINE_SEP).append("    iv:").append(LINE_SEP).append('[')
 141                 .append(encoder.encodeBuffer(iv)).append(']').append(LINE_SEP)
 142                 .append("tLen(bits):").append(LINE_SEP).append(tLen * 8)
 143                 .append(LINE_SEP);
 144         return sb.toString();
 145     }
 146 }