Home | History | Annotate | Download | only in cert

Lines Matching refs:Encoding

82      * Supported encoding types for CerthPath. Used by the various APIs that
85 private enum Encoding {
91 Encoding(String apiName) {
95 static Encoding findByApiName(String apiName) throws CertificateEncodingException {
96 for (Encoding element : values()) {
108 Encoding.PKI_PATH.apiName,
109 Encoding.PKCS7.apiName,
115 /** PkiPath encoding of the certification path. */
118 /** PKCS7 encoding of the certification path. */
149 * expected output for the {@code type} of encoding.
151 private X509CertPathImpl(List<X509Certificate> certs, Encoding type) {
177 return new X509CertPathImpl(result, Encoding.PKCS7);
196 * Generates certification path object on the basis of encoding provided via
198 * parameter <code>encoding</code>.
200 * @throws CertificateException if specified encoding form is not supported,
203 public static X509CertPathImpl getInstance(InputStream in, String encoding)
206 final Encoding encType = Encoding.findByApiName(encoding);
208 throw new CertificateException("Unsupported encoding: " + encoding);
217 throw new CertificateException("Unsupported encoding: " + encoding);
239 * Generates certification path object on the base of encoding provided via
241 * parameter {@code encoding}.
243 * @throws CertificateException if specified encoding form is not supported,
246 public static X509CertPathImpl getInstance(byte[] in, String encoding)
249 final Encoding encType = Encoding.findByApiName(encoding);
251 throw new CertificateException("Unsupported encoding: " + encoding);
260 throw new CertificateException("Unsupported encoding: " + encoding);
281 * Returns in PkiPath format which is our default encoding.
287 return getEncoded(Encoding.PKI_PATH);
293 private byte[] getEncoded(Encoding encoding) throws CertificateEncodingException {
294 switch (encoding) {
308 throw new CertificateEncodingException("Unsupported encoding: " + encoding);
316 public byte[] getEncoded(String encoding) throws CertificateEncodingException {
317 final Encoding encType = Encoding.findByApiName(encoding);
319 throw new CertificateEncodingException("Unsupported encoding: " + encoding);
358 return new X509CertPathImpl(certificates, Encoding.PKI_PATH);
364 * This method participates in encoding process.
385 throw new IllegalArgumentException("Encoding error occurred", e);
436 // precalculated ASN.1 encoding for SignedData object oid