@Override public Object decode(BerInputStream in) throws IOException { return ((List<?>) super.decode(in)).get(0); } };
/** * 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); } }
/** * 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); } }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { dn = (Name) Name.ASN1.decode((byte[]) in.readObject()); }
/** * 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); } }
/** * 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); } }
/** * 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; }
/** * Generates certification path object on the basis of encoding provided via * input stream. The format of provided encoded form is specified by * parameter <code>encoding</code>. * * @throws CertificateException if specified encoding form is not supported, * or some problems occurred during the decoding. */ public static X509CertPathImpl getInstance(InputStream in, String encoding) throws CertificateException { try { final Encoding encType = Encoding.findByApiName(encoding); if (encType == null) { throw new CertificateException("Unsupported encoding: " + encoding); } switch (encType) { case PKI_PATH: return (X509CertPathImpl) ASN1.decode(in); case PKCS7: return getCertPathFromContentInfo((ContentInfo) ContentInfo.ASN1.decode(in)); default: throw new CertificateException("Unsupported encoding: " + encoding); } } catch (IOException e) { throw new CertificateException("Failed to decode CertPath", e); } }
/** * Generates certification path object on the base of encoding provided via * array of bytes. The format of provided encoded form is specified by * parameter {@code encoding}. * * @throws CertificateException if specified encoding form is not supported, * or some problems occurred during the decoding. */ public static X509CertPathImpl getInstance(byte[] in, String encoding) throws CertificateException { try { final Encoding encType = Encoding.findByApiName(encoding); if (encType == null) { throw new CertificateException("Unsupported encoding: " + encoding); } switch (encType) { case PKI_PATH: return (X509CertPathImpl) ASN1.decode(in); case PKCS7: return getCertPathFromContentInfo((ContentInfo) ContentInfo.ASN1.decode(in)); default: throw new CertificateException("Unsupported encoding: " + encoding); } } catch (IOException e) { throw new CertificateException("Failed to decode CertPath", e); } }
@Override public Object decode(BerInputStream in) throws IOException { return ((List<?>) super.decode(in)).get(0); } };
@Override public Object decode(BerInputStream in) throws IOException { return ((List<?>) super.decode(in)).get(0); } };
@Override public Object decode(BerInputStream in) throws IOException { return ((List<?>) super.decode(in)).get(0); } };
@Override public Object decode(BerInputStream in) throws IOException { return ((List<?>) super.decode(in)).get(0); } };
@Override public Object decode(BerInputStream in) throws IOException { return ((List<?>) super.decode(in)).get(0); } };
/** * 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); } }
/** * 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); } }
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { dn = (Name) Name.ASN1.decode((byte[]) in.readObject()); }
/** * 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); } }
@Override public Object decode(BerInputStream in) throws IOException { return ((List<?>) super.decode(in)).get(0); } };
/** * 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); } }