// Encode this extension private void encodeThis() throws IOException { DerOutputStream os = new DerOutputStream(); try { names.encode(os); } catch (GeneralNamesException e) { throw new IOException("SubjectAlternativeName: " + e); } extensionValue = os.toByteArray(); }
/** * Write the extension to the OutputStream. * * @param out the OutputStream to write the extension to. * @exception IOException on encoding errors. */ public void encode(OutputStream out) throws IOException { DerOutputStream tmp = new DerOutputStream(); if (extensionValue == null) { extensionId = PKIXExtensions.SubjectAlternativeName_Id; // critical = false; encodeThis(); } super.encode(tmp); out.write(tmp.toByteArray()); }
/** * Encode the RFC822 name into the DerOutputStream. * * @param out the DER stream to encode the RFC822Name to. * @exception IOException on encoding errors. */ public void encode(DerOutputStream out) throws IOException { out.putIA5String(name); }