@Override public Object decode(BerInputStream in) throws IOException { return ((List<?>) super.decode(in)).get(0); } };
/** * Gets encoded form of DN * * @return return encoding, no copying is performed */ public byte[] getEncoded() { if (encoded == null) { encoded = ASN1.encode(this); } return encoded; }
public Object decode(BerInputStream in) throws IOException { in.readSequenceOf(this); if (in.isVerify) { return null; } return getDecodedObject(in); }
/** * Generates certification path object on the base of PkiPath * encoded form provided via array of bytes. * @throws CertificateException if some problems occurred during * the decoding. */ public static X509CertPathImpl getInstance(byte[] in) throws CertificateException { try { return (X509CertPathImpl) ASN1.decode(in); } catch (IOException e) { throw new CertificateException("Failed to decode CertPath", e); } }
/** * @see #getEncoded(String) */ private byte[] getEncoded(Encoding encoding) throws CertificateEncodingException { switch (encoding) { case PKI_PATH: if (pkiPathEncoding == null) { pkiPathEncoding = ASN1.encode(this); } return pkiPathEncoding.clone(); case PKCS7: if (pkcs7Encoding == null) { pkcs7Encoding = PKCS7_SIGNED_DATA_OBJECT.encode(this); } return pkcs7Encoding.clone(); default: throw new CertificateEncodingException("Unsupported encoding: " + encoding); } }
public Object decode(BerInputStream in) throws IOException { in.readSequenceOf(this); if (in.isVerify) { return null; } return getDecodedObject(in); }
/** * Generates certification path object on the base of PkiPath encoded form * provided via input stream. * * @throws CertificateException if some problems occurred during the * decoding. */ public static X509CertPathImpl getInstance(InputStream in) throws CertificateException { try { return (X509CertPathImpl) ASN1.decode(in); } catch (IOException e) { throw new CertificateException("Failed to decode CertPath", e); } }
/** * Gets encoded form of DN * * @return return encoding, no copying is performed */ public byte[] getEncoded() { if (encoded == null) { encoded = ASN1.encode(this); } return encoded; }
public Object decode(BerInputStream in) throws IOException { in.readSequenceOf(this); if (in.isVerify) { return null; } return getDecodedObject(in); }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { dn = (Name) Name.ASN1.decode((byte[]) in.readObject()); }
/** * Gets encoded form of DN * * @return return encoding, no copying is performed */ public byte[] getEncoded() { if (encoded == null) { encoded = ASN1.encode(this); } return encoded; }
public Object decode(BerInputStream in) throws IOException { in.readSequenceOf(this); if (in.isVerify) { return null; } return getDecodedObject(in); }
/** * Creates a new X500Principal from a given ASN.1 DER encoding of a * distinguished name. * * @param name * the ASN.1 DER-encoded distinguished name * * @throws IllegalArgumentException * if the ASN.1 DER-encoded distinguished name is incorrect */ public X500Principal(byte[] name) { if (name == null) { throw new IllegalArgumentException("Name cannot be null"); } try { // FIXME dn = new Name(name); dn = (Name) Name.ASN1.decode(name); } catch (IOException e) { throw incorrectInputEncoding(e); } }
/** * Gets encoded form of DN * * @return return encoding, no copying is performed */ public byte[] getEncoded() { if (encoded == null) { encoded = ASN1.encode(this); } return encoded; }
public Object decode(BerInputStream in) throws IOException { in.readSequenceOf(this); if (in.isVerify) { return null; } return getDecodedObject(in); }
/** * Creates a new X500Principal from a given ASN.1 DER encoding of a * distinguished name. * * @param in * an {@code InputStream} holding the ASN.1 DER-encoded * distinguished name * * @throws IllegalArgumentException * if the ASN.1 DER-encoded distinguished name is incorrect */ public X500Principal(InputStream in) { if (in == null) { throw new NullPointerException("in == null"); } try { // FIXME dn = new Name(is); dn = (Name) Name.ASN1.decode(in); } catch (IOException e) { throw incorrectInputEncoding(e); } }
/** * Gets encoded form of DN * * @return return encoding, no copying is performed */ public byte[] getEncoded() { if (encoded == null) { encoded = ASN1.encode(this); } return encoded; }
public Object decode(BerInputStream in) throws IOException { in.readSequenceOf(this); if (in.isVerify) { return null; } return getDecodedObject(in); }
/** * Creates new <code>Name</code> instance from its DER encoding * * @param encoding - ASN.1 DER encoding * @throws IOException - if encoding is wrong */ public Name(byte[] encoding) throws IOException { DerInputStream in = new DerInputStream(encoding); if (in.getEndOffset() != encoding.length) { throw new IOException("Wrong content length"); } ASN1.decode(in); this.rdn = (List<List<AttributeTypeAndValue>>) in.content; }
/** * Gets encoded form of DN * * @return return encoding, no copying is performed */ public byte[] getEncoded() { if (encoded == null) { encoded = ASN1.encode(this); } return encoded; }