/** * DER decode the object * * @param buf DERBuffer */ public void derDecode(DERBuffer buf) throws IOException { // Decode the type if ((buf.unpackType() & DER.Application) != 0) { // Unpack the length and bytes int len = buf.unpackLength(); if (len > 0) { // Get the string bytes m_bytes = buf.unpackBytes(len); } else m_bytes = null; } else throw new IOException("Wrong DER type, expected ApplicationSpecific"); }
/** * Decode the object * * @param buf * @throws IOException */ public void derDecode(DERBuffer buf) throws IOException { // Decode the type if (buf.unpackType() == DER.GeneralizedTime) { // Unpack the length and bytes int len = buf.unpackLength(); if (len > 0) { // Get the string bytes byte[] byts = buf.unpackBytes(len); m_string = new String(byts); } else m_string = null; } else throw new IOException("Wrong DER type, expected GeneralString"); }