public byte[] getExtensionValue(String oid) { Extension ext = getExtension(new ASN1ObjectIdentifier(oid)); if (ext != null) { try { return ext.getExtnValue().getEncoded(); } catch (Exception e) { throw new RuntimeException("error encoding " + e.toString()); } } return null; }
public byte[] getExtensionValue(String oid) { Extension ext = getExtension(new ASN1ObjectIdentifier(oid)); if (ext != null) { try { return ext.getExtnValue().getEncoded(); } catch (Exception e) { throw new IllegalStateException("Exception encoding: " + e.toString()); } } return null; }
public byte[] getExtensionValue(String oid) { Extensions extensions = cert.getAcinfo().getExtensions(); if (extensions != null) { Extension ext = extensions.getExtension(new ASN1ObjectIdentifier(oid)); if (ext != null) { try { return ext.getExtnValue().getEncoded(ASN1Encoding.DER); } catch (Exception e) { throw new RuntimeException("error encoding " + e.toString()); } } } return null; }
public byte[] getExtensionValue(String oid) { Extensions exts = c.getTBSCertificate().getExtensions(); if (exts != null) { Extension ext = exts.getExtension(new ASN1ObjectIdentifier(oid)); if (ext != null) { try { return ext.getExtnValue().getEncoded(); } catch (Exception e) { throw new IllegalStateException("error parsing " + e.toString()); } } } return null; }
public byte[] getExtensionValue(String oid) { Extensions exts = c.getTBSCertList().getExtensions(); if (exts != null) { Extension ext = exts.getExtension(new ASN1ObjectIdentifier(oid)); if (ext != null) { try { return ext.getExtnValue().getEncoded(); } catch (Exception e) { throw new IllegalStateException("error parsing " + e.toString()); } } } return null; }
public byte[] getExtensionValue(String oid) { Extensions exts = c.getTBSCertificate().getExtensions(); if (exts != null) { Extension ext = exts.getExtension(new ASN1ObjectIdentifier(oid)); if (ext != null) { try { return ext.getExtnValue().getEncoded(); } catch (Exception e) { throw new IllegalStateException("error parsing " + e.toString()); } } } return null; }
public static byte[] extractNonce(OCSPReq request) throws IOException { Extension nonceExt = request.getExtension(OCSPObjectIdentifiers.id_pkix_ocsp_nonce); if (nonceExt == null) return null; byte[] nonceAsn = nonceExt.getExtnValue().getEncoded(); if (nonceAsn == null) return null; ASN1OctetString octs; try { octs = (ASN1OctetString)ASN1Primitive.fromByteArray(nonceAsn); } catch (Exception e) { throw new IllegalStateException("Can't decode nonce encoded in request", e); } return octs.getOctets(); } }
public byte[] getExtensionValue(String oid) { Extensions exts = c.getTBSCertList().getExtensions(); if (exts != null) { Extension ext = exts.getExtension(new ASN1ObjectIdentifier(oid)); if (ext != null) { try { return ext.getExtnValue().getEncoded(); } catch (Exception e) { throw new IllegalStateException("error parsing " + e.toString()); } } } return null; }
/** * Creates an X509ExtensionSet object from the extensions in the ASN1 sequence. * * @param extensions Sequence with extensions. */ public X509ExtensionSet(ASN1Sequence extensions) { ASN1Encodable[] asn1Encodables = extensions.toArray(); for (int i = 0; i < asn1Encodables.length; i++) { ASN1Encodable asn1Encodable = asn1Encodables[i]; Extension ext = Extension.getInstance(asn1Encodable); if (ext != null) { try { addExtension(ext.getExtnId().toString(), ext.isCritical(), ext.getExtnValue().getEncoded()); } catch (IOException e) { // ignore exception from getEncoded() } } } }
getExtnValue().getEncoded(); } catch (IOException e1)