155 * @return the byte array of encoded KrbCredInfo object. |
155 * @return the byte array of encoded KrbCredInfo object. |
156 * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data. |
156 * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data. |
157 * @exception IOException if an I/O error occurs while reading encoded data. |
157 * @exception IOException if an I/O error occurs while reading encoded data. |
158 */ |
158 */ |
159 public byte[] asn1Encode() throws Asn1Exception, IOException { |
159 public byte[] asn1Encode() throws Asn1Exception, IOException { |
160 Vector<DerValue> v = new Vector<DerValue> (); |
160 Vector<DerValue> v = new Vector<>(); |
161 v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x00), key.asn1Encode())); |
161 v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x00), key.asn1Encode())); |
162 if (prealm != null) |
162 if (prealm != null) |
163 v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x01), prealm.asn1Encode())); |
163 v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x01), prealm.asn1Encode())); |
164 if (pname != null) |
164 if (pname != null) |
165 v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x02), pname.asn1Encode())); |
165 v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x02), pname.asn1Encode())); |