try String urlString = new String(uri.getOctets()); LOG.info("CA issuers URL: " + urlString); in = new URL(urlString).openStream();
String url = new String(uri.getOctets());
String ocspURL = new String(url.getOctets()); LOG.info("OCSP URL: " + ocspURL); return ocspURL;
ASN1Primitive derObjCrlDP = oAsnInStream.readObject(); DEROctetString dosCrlDP = (DEROctetString) derObjCrlDP; byte[] crldpExtOctets = dosCrlDP.getOctets(); ASN1InputStream oAsnInStream2 = new ASN1InputStream(new ByteArrayInputStream(crldpExtOctets)); ASN1Primitive derObj2 = oAsnInStream2.readObject();
private boolean matchStringValue(String matchKey, JsonNode matchValue, ASN1Primitive value) { if (value instanceof DEROctetString) { final String readValue = new String(((DEROctetString) value).getOctets(), CHARSET); return matchValue.asText().equals(readValue); } else { log.debug("Expected text string value for extension {}, was: {}", matchKey, value); return false; } }
/** * This method checks if a given {@code DEROctetString} is null. * * @param derOctetString * the {@code DEROctetString} to check * @return true if the {@code DEROctetString} contains DERNull */ private static boolean isDEROctetStringNull(final DEROctetString derOctetString) { final byte[] derOctetStringBytes = derOctetString.getOctets(); final ASN1Primitive asn1Null = toASN1Primitive(derOctetStringBytes); return DERNull.INSTANCE.equals(asn1Null); }
/** * This method checks if a given {@code DEROctetString} is null. * * @param derOctetString * @return */ public static boolean isDEROctetStringNull(final DEROctetString derOctetString) { final byte[] derOctetStringBytes = derOctetString.getOctets(); final ASN1Primitive asn1Null = DSSASN1Utils.toASN1Primitive(derOctetStringBytes); return DERNull.INSTANCE.equals(asn1Null); }
public PrivateKey(ASN1Primitive primitive) { DERIterator i = DER.asSequence(primitive); privateKey = DER.as(DEROctetString.class, i) .getOctets(); publicKeyInfo = i.optional() .map(PublicKeyInfo::new); }
public NOS(ASN1Primitive primitive) { DERIterator i = DER.asSequence(primitive); x = DER.as(ASN1Integer.class, i) .getValue() .intValue(); y = i.nextIf(ASN1Integer.class) .map(ASN1Integer::getValue) .map(BigInteger::intValue); key = DER.as(DEROctetString.class, i) .getOctets(); }
private static byte[] getDEROctetStringContent(byte[] bytes) { try (ASN1InputStream input = new ASN1InputStream(bytes)) { final DEROctetString s = (DEROctetString) input.readObject(); return s.getOctets(); } catch (IOException e) { throw new DSSException("Unable to retrieve the DEROctetString content", e); } }
public TypeData(ASN1Primitive primitive) { DERIterator i = DER.asSequence(primitive); type = DER.as(ASN1Integer.class, i) .getValue() .intValue(); data = DER.as(DEROctetString.class, i) .getOctets(); }
public EncryptedKey(ASN1Primitive primitive) { DERIterator i = DER.asSequence(primitive); masterKey = new NOS(i.next()); wrappedKey = DER.as(DEROctetString.class, i) .getOctets(); flags = i.optional() .map(DER.as(ASN1Integer.class)) .map(ASN1Integer::getValue) .map(BigInteger::intValue); }
public Item(ASN1Primitive primitive) { DERIterator i = DER.asSequence(primitive); version = DER.as(ASN1Integer.class, i) .getValue() .intValue(); data = DER.as(DEROctetString.class, i) .getOctets(); }
private Nonce toNonce(final Attribute attr) { // Sometimes we don't get a sender nonce. if (attr == null) { return null; } final DEROctetString octets = (DEROctetString) attr.getAttrValues() .getObjectAt(0); return new Nonce(octets.getOctets()); }
private byte[] getAuthorityKeyId(X509Certificate cert) throws IOException { byte[] extvalue = cert.getExtensionValue(X509Extensions.AuthorityKeyIdentifier.getId()); if (extvalue == null) { return null; } DEROctetString oct = (DEROctetString) (new ASN1InputStream(new ByteArrayInputStream(extvalue)).readObject()); AuthorityKeyIdentifier keyId = new AuthorityKeyIdentifier( (ASN1Sequence) new ASN1InputStream(new ByteArrayInputStream(oct.getOctets())).readObject()); return keyId.getKeyIdentifier(); } }
public SignatureInfo(ASN1Primitive primitive) { DERIterator i = DER.asSequence(primitive); DERIterator j = DER.asSequence(i); version = DER.as(ASN1Integer.class, j) .getValue() .intValue(); info = DER.as(DEROctetString.class, j) .getOctets(); }
private CRLDistPoint getOctetInputStream(DEROctetString crlDEROctetString) throws CertificateVerificationException { try (ASN1InputStream asn1InOctets = new ASN1InputStream(crlDEROctetString.getOctets())) { ASN1Primitive crlDERObject = asn1InOctets.readObject(); return CRLDistPoint.getInstance(crlDERObject); } catch (IOException e) { throw new CertificateVerificationException("Cannot read certificate to get CRL URLs", e); } } }
private Nonce getNonce(DERObjectIdentifier oid) { final Attribute attr = getAttributeTable().get(oid); if (attr == null) { return null; } final DEROctetString nonce = (DEROctetString) attr.getAttrValues().getObjectAt(0); return new Nonce(nonce.getOctets()); }