ASN1InputStream oAsnInStream2 = new ASN1InputStream(new ByteArrayInputStream(crldpExtOctets)); ASN1Primitive derObj2 = oAsnInStream2.readObject(); CRLDistPoint distPoint = CRLDistPoint.getInstance(derObj2); List<String> crlUrls = new ArrayList<>(); for (DistributionPoint dp : distPoint.getDistributionPoints())
new CRLDistPoint(new DistributionPoint[] { new DistributionPoint(distPointOne, null, null) }));
private String CRLPointsExtractor(ASN1Primitive primitive) { CRLDistPoint point = CRLDistPoint.getInstance(primitive); return point.toString(); }
public static CRLDistPoint getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); }
public String toString() { StringBuffer buf = new StringBuffer(); String sep = System.getProperty("line.separator"); buf.append("CRLDistPoint:"); buf.append(sep); DistributionPoint dp[] = getDistributionPoints(); for (int i = 0; i != dp.length; i++) { buf.append(" "); buf.append(dp[i]); buf.append(sep); } return buf.toString(); } }
ASN1OctetString octs = (ASN1OctetString) aIn.readObject(); aIn = new ASN1InputStream(new ByteArrayInputStream(octs.getOctets())); CRLDistPoint cdp = new CRLDistPoint((ASN1Sequence) aIn.readObject()); DistributionPoint[] distpoints = cdp.getDistributionPoints(); if (distpoints!=null) { Collection<CRL> results = new HashSet<CRL>();
boolean criticalCrlDistPoints = getProperty(PROPERTY_CERT_CRITICAL_CRL_DISTRIBUTION_POINTS, false); extensions.add(new Extension(Extension.cRLDistributionPoints, criticalCrlDistPoints, new CRLDistPoint(crlDistributionPoints).getEncoded()));
public static CRLDistPoint getInstance( ASN1TaggedObject obj, boolean explicit) { return getInstance(ASN1Sequence.getInstance(obj, explicit)); }
public String toString() { StringBuffer buf = new StringBuffer(); String sep = Strings.lineSeparator(); buf.append("CRLDistPoint:"); buf.append(sep); DistributionPoint dp[] = getDistributionPoints(); for (int i = 0; i != dp.length; i++) { buf.append(" "); buf.append(dp[i]); buf.append(sep); } return buf.toString(); } }
/** * Determines if a certificate has CRL distribution point extension. * @param cert The certificate to check. * @return True is the certificate contains a CRL distribution point extension. False otherwise. */ public static boolean isCRLDispPointDefined(X509Certificate cert) { boolean retVal = false; try { CRLDistPoint distPoints = CRLDistPoint.getInstance(getExtensionValue(cert, X509Extensions.CRLDistributionPoints.getId())); if (distPoints != null && distPoints.getDistributionPoints() != null && distPoints.getDistributionPoints().length > 0) retVal = true; } catch (Exception e){/*no-op */ } return retVal; }
public static CRLDistPoint fromExtensions(Extensions extensions) { return CRLDistPoint.getInstance(extensions.getExtensionParsedValue(Extension.cRLDistributionPoints)); }
try dps = crldp.getDistributionPoints();
public static CRLDistPoint getInstance( Object obj) { if (obj instanceof CRLDistPoint) { return (CRLDistPoint)obj; } else if (obj != null) { return new CRLDistPoint(ASN1Sequence.getInstance(obj)); } return null; }
private String getCrlDistributionPointsStringValue(byte[] value) throws IOException { // @formatter:off /* * CRLDistPointSyntax ::= ASN1Sequence SIZE (1..MAX) OF * DistributionPoint */ // @formatter:on StringBuilder sb = new StringBuilder(); CRLDistPoint crlDistributionPoints = CRLDistPoint.getInstance(value); int distPoint = 0; for (DistributionPoint distributionPoint : crlDistributionPoints.getDistributionPoints()) { distPoint++; sb.append(MessageFormat.format(res.getString("CrlDistributionPoint"), distPoint)); sb.append(NEWLINE); sb.append(getDistributionPointString(distributionPoint, INDENT.toString(1))); } return sb.toString(); }
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); } } }
try dps = crldp.getDistributionPoints();
public static CRLDistPoint getInstance( Object obj) { if (obj instanceof CRLDistPoint) { return (CRLDistPoint)obj; } else if (obj != null) { return new CRLDistPoint(ASN1Sequence.getInstance(obj)); } return null; }
@Override public DistributionPoint[] getCRLDistributionPoints( X509Certificate cert ) { try { byte[] value = cert.getExtensionValue( X509Extensions.CRLDistributionPoints.getId() ); if ( value == null ) { return null; } CRLDistPoint crlDistPoints = CRLDistPoint.getInstance( X509ExtensionUtil.fromExtensionValue( value ) ); return crlDistPoints.getDistributionPoints(); } catch ( IOException ex ) { throw new CryptoFailure( "Unable to extract CRLDistributionPoints from X509Certificate extensions", ex ); } }
CRLDistPoint.getInstance(dIn.readObject())).append(nl); CRLDistPoint.getInstance(dIn.readObject())).append(nl);
protected Vector getCRLDistUrls(CRLDistPoint crlDistPoints) { Vector urls = new Vector(); if (crlDistPoints != null) { DistributionPoint[] distPoints = crlDistPoints.getDistributionPoints(); if (distPoints == null) return urls; for (int i = 0; i < distPoints.length; i++) { DistributionPointName dp_name = distPoints[i].getDistributionPoint(); if (dp_name != null && dp_name.getType() == DistributionPointName.FULL_NAME) { GeneralName[] generalNames = GeneralNames.getInstance(dp_name.getName()).getNames(); for (int j = 0; j < generalNames.length; j++) { if (generalNames[j].getTagNo() == GeneralName.uniformResourceIdentifier) { String url = ((DERIA5String) generalNames[j].getName()).getString(); urls.add(url); } } } } } return urls; } }