/** * Return an AttributeCertificate interpretation of otherCert. * @deprecated use getOtherCert and getOtherTag to make sure message is really what it should be. * * @return an AttributeCertificate */ public AttributeCertificate getX509v2AttrCert() { return AttributeCertificate.getInstance(otherCert); }
private void readObject( ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); init(AttributeCertificate.getInstance(in.readObject())); }
private static AttributeCertificate getObject(InputStream in) throws IOException { try { return AttributeCertificate.getInstance(new ASN1InputStream(in).readObject()); } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException("exception decoding certificate structure: " + e.toString()); } }
private static AttributeCertificate getObject(InputStream in) throws IOException { try { return AttributeCertificate.getInstance(new ASN1InputStream(in).readObject()); } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException("exception decoding certificate structure: " + e.toString()); } }
private static AttributeCertificate parseBytes(byte[] certEncoding) throws IOException { try { return AttributeCertificate.getInstance(ASN1Primitive.fromByteArray(certEncoding)); } catch (ClassCastException e) { throw new CertIOException("malformed data: " + e.getMessage(), e); } catch (IllegalArgumentException e) { throw new CertIOException("malformed data: " + e.getMessage(), e); } }
private static AttributeCertificate parseBytes(byte[] certEncoding) throws IOException { try { return AttributeCertificate.getInstance(CertUtils.parseNonEmptyASN1(certEncoding)); } catch (ClassCastException e) { throw new CertIOException("malformed data: " + e.getMessage(), e); } catch (IllegalArgumentException e) { throw new CertIOException("malformed data: " + e.getMessage(), e); } }
public static CMPCertificate getInstance(Object o) { if (o == null || o instanceof CMPCertificate) { return (CMPCertificate)o; } if (o instanceof ASN1Sequence) { return new CMPCertificate(Certificate.getInstance(o)); } if (o instanceof ASN1TaggedObject) { return new CMPCertificate(AttributeCertificate.getInstance(((ASN1TaggedObject)o).getObject())); } throw new IllegalArgumentException("Invalid object: " + o.getClass().getName()); }
Store getAttributeCertificates(ASN1Set certSet) { if (certSet != null) { List certList = new ArrayList(certSet.size()); for (Enumeration en = certSet.getObjects(); en.hasMoreElements();) { ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive(); if (obj instanceof ASN1TaggedObject) { certList.add(new X509AttributeCertificateHolder(AttributeCertificate.getInstance(((ASN1TaggedObject)obj).getObject()))); } } return new CollectionStore(certList); } return new CollectionStore(new ArrayList()); }
Store getAttributeCertificates(ASN1Set certSet) { if (certSet != null) { List certList = new ArrayList(certSet.size()); for (Enumeration en = certSet.getObjects(); en.hasMoreElements();) { ASN1Primitive obj = ((ASN1Encodable)en.nextElement()).toASN1Primitive(); if (obj instanceof ASN1TaggedObject) { certList.add(new X509AttributeCertificateHolder(AttributeCertificate.getInstance(((ASN1TaggedObject)obj).getObject()))); } } return new CollectionStore(certList); } return new CollectionStore(new ArrayList()); }
private static AttributeCertificate generateAttrStructure(AttributeCertificateInfo attrInfo, AlgorithmIdentifier sigAlgId, byte[] signature) { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(attrInfo); v.add(sigAlgId); v.add(new DERBitString(signature)); return AttributeCertificate.getInstance(new DERSequence(v)); }
private static AttributeCertificate generateAttrStructure(AttributeCertificateInfo attrInfo, AlgorithmIdentifier sigAlgId, byte[] signature) { ASN1EncodableVector v = new ASN1EncodableVector(); v.add(attrInfo); v.add(sigAlgId); v.add(new DERBitString(signature)); return AttributeCertificate.getInstance(new DERSequence(v)); }
private SignerAttribute( ASN1Sequence seq) { int index = 0; values = new Object[seq.size()]; for (Enumeration e = seq.getObjects(); e.hasMoreElements();) { ASN1TaggedObject taggedObject = ASN1TaggedObject.getInstance(e.nextElement()); if (taggedObject.getTagNo() == 0) { ASN1Sequence attrs = ASN1Sequence.getInstance(taggedObject, true); Attribute[] attributes = new Attribute[attrs.size()]; for (int i = 0; i != attributes.length; i++) { attributes[i] = Attribute.getInstance(attrs.getObjectAt(i)); } values[index] = attributes; } else if (taggedObject.getTagNo() == 1) { values[index] = AttributeCertificate.getInstance(ASN1Sequence.getInstance(taggedObject, true)); } else { throw new IllegalArgumentException("illegal tag: " + taggedObject.getTagNo()); } index++; } }
private SignerAttribute( ASN1Sequence seq) { int index = 0; values = new Object[seq.size()]; for (Enumeration e = seq.getObjects(); e.hasMoreElements();) { ASN1TaggedObject taggedObject = ASN1TaggedObject.getInstance(e.nextElement()); if (taggedObject.getTagNo() == 0) { ASN1Sequence attrs = ASN1Sequence.getInstance(taggedObject, true); Attribute[] attributes = new Attribute[attrs.size()]; for (int i = 0; i != attributes.length; i++) { attributes[i] = Attribute.getInstance(attrs.getObjectAt(i)); } values[index] = attributes; } else if (taggedObject.getTagNo() == 1) { values[index] = AttributeCertificate.getInstance(ASN1Sequence.getInstance(taggedObject, true)); } else { throw new IllegalArgumentException("illegal tag: " + taggedObject.getTagNo()); } index++; } }