Java Code Examples for org.bouncycastle.asn1.DERTaggedObject#getObject()
The following examples show how to use
org.bouncycastle.asn1.DERTaggedObject#getObject() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BasicCertificate.java From signer with GNU Lesser General Public License v3.0 | 6 votes |
/** * * * @return the authority key identifier of a certificate * */ public String getAuthorityKeyIdentifier() { // TODO - Precisa validar este metodo com a RFC try { DLSequence sequence = (DLSequence) getExtensionValue(Extension.authorityKeyIdentifier.getId()); if (sequence == null || sequence.size() == 0) { return null; } DERTaggedObject taggedObject = (DERTaggedObject) sequence.getObjectAt(0); DEROctetString oct = (DEROctetString) taggedObject.getObject(); return toString(oct.getOctets()); } catch (Exception error) { logger.info(error.getMessage()); return null; } }
Example 2
Source File: OcspRef.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
private String getResponderIdByName() { RespID responderId = this.ocsp.getResponderId(); ResponderID responderIdAsASN1Object = responderId.toASN1Primitive(); DERTaggedObject derTaggedObject = (DERTaggedObject)responderIdAsASN1Object.toASN1Primitive(); if (2 == derTaggedObject.getTagNo()) { return null; } else { ASN1Primitive derObject = derTaggedObject.getObject(); X500Name name = X500Name.getInstance(derObject); return RFC2253Parser.normalize(name.toString()); } }
Example 3
Source File: OcspRef.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
private byte[] getResponderIdByKey() { ResponderID responderID = this.ocsp.getResponderId().toASN1Primitive(); DERTaggedObject derTaggedObject = (DERTaggedObject)responderID.toASN1Primitive(); if (2 == derTaggedObject.getTagNo()) { ASN1OctetString keyHashOctetString = (ASN1OctetString)derTaggedObject.getObject(); return keyHashOctetString.getOctets(); } else { return new byte[0]; } }
Example 4
Source File: OcspRef.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
private String getResponderIdByName() { RespID responderId = this.ocsp.getResponderId(); ResponderID responderIdAsASN1Object = responderId.toASN1Primitive(); DERTaggedObject derTaggedObject = (DERTaggedObject)responderIdAsASN1Object.toASN1Primitive(); if (2 == derTaggedObject.getTagNo()) { return null; } else { ASN1Primitive derObject = derTaggedObject.getObject(); X500Name name = X500Name.getInstance(derObject); return RFC2253Parser.normalize(name.toString()); } }
Example 5
Source File: OcspRef.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
private byte[] getResponderIdByKey() { ResponderID responderID = this.ocsp.getResponderId().toASN1Primitive(); DERTaggedObject derTaggedObject = (DERTaggedObject)responderID.toASN1Primitive(); if (2 == derTaggedObject.getTagNo()) { ASN1OctetString keyHashOctetString = (ASN1OctetString)derTaggedObject.getObject(); return keyHashOctetString.getOctets(); } else { return new byte[0]; } }
Example 6
Source File: OcspRef.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
private String getResponderIdByName() { RespID responderId = this.ocsp.getResponderId(); ResponderID responderIdAsASN1Object = responderId.toASN1Primitive(); DERTaggedObject derTaggedObject = (DERTaggedObject)responderIdAsASN1Object.toASN1Primitive(); if (2 == derTaggedObject.getTagNo()) { return null; } else { ASN1Primitive derObject = derTaggedObject.getObject(); X500Name name = X500Name.getInstance(derObject); return RFC2253Parser.normalize(name.toString()); } }
Example 7
Source File: OcspRef.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
private byte[] getResponderIdByKey() { ResponderID responderID = this.ocsp.getResponderId().toASN1Primitive(); DERTaggedObject derTaggedObject = (DERTaggedObject)responderID.toASN1Primitive(); if (2 == derTaggedObject.getTagNo()) { ASN1OctetString keyHashOctetString = (ASN1OctetString)derTaggedObject.getObject(); return keyHashOctetString.getOctets(); } else { return new byte[0]; } }
Example 8
Source File: OcspRef.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
private String getResponderIdByName() { RespID responderId = this.ocsp.getResponderId(); ResponderID responderIdAsASN1Object = responderId.toASN1Primitive(); DERTaggedObject derTaggedObject = (DERTaggedObject)responderIdAsASN1Object.toASN1Primitive(); if (2 == derTaggedObject.getTagNo()) { return null; } else { ASN1Primitive derObject = derTaggedObject.getObject(); X500Name name = X500Name.getInstance(derObject); return RFC2253Parser.normalize(name.toString()); } }
Example 9
Source File: OcspRef.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
private byte[] getResponderIdByKey() { ResponderID responderID = this.ocsp.getResponderId().toASN1Primitive(); DERTaggedObject derTaggedObject = (DERTaggedObject)responderID.toASN1Primitive(); if (2 == derTaggedObject.getTagNo()) { ASN1OctetString keyHashOctetString = (ASN1OctetString)derTaggedObject.getObject(); return keyHashOctetString.getOctets(); } else { return new byte[0]; } }
Example 10
Source File: OcspRef.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
private String getResponderIdByName() { RespID responderId = this.ocsp.getResponderId(); ResponderID responderIdAsASN1Object = responderId.toASN1Primitive(); DERTaggedObject derTaggedObject = (DERTaggedObject)responderIdAsASN1Object.toASN1Primitive(); if (2 == derTaggedObject.getTagNo()) { return null; } else { ASN1Primitive derObject = derTaggedObject.getObject(); X500Name name = X500Name.getInstance(derObject); return RFC2253Parser.normalize(name.toString()); } }
Example 11
Source File: OcspRef.java From freehealth-connector with GNU Affero General Public License v3.0 | 5 votes |
private byte[] getResponderIdByKey() { ResponderID responderID = this.ocsp.getResponderId().toASN1Primitive(); DERTaggedObject derTaggedObject = (DERTaggedObject)responderID.toASN1Primitive(); if (2 == derTaggedObject.getTagNo()) { ASN1OctetString keyHashOctetString = (ASN1OctetString)derTaggedObject.getObject(); return keyHashOctetString.getOctets(); } else { return new byte[0]; } }
Example 12
Source File: PathLenConstraint.java From signer with GNU Lesser General Public License v3.0 | 5 votes |
@Override public void parse(ASN1Primitive derObject) { DERTaggedObject derTaggedObject = (DERTaggedObject) derObject; DERSequence derSequence = (DERSequence) derTaggedObject.getObject(); int total = derSequence.size(); for (int i = 0; i < total; i++) { ObjectIdentifier objectIdentifier = new ObjectIdentifier(); objectIdentifier.parse(derSequence.getObjectAt(i).toASN1Primitive()); if (this.pathLenConstraints == null) { this.pathLenConstraints = new ArrayList<ObjectIdentifier>(); } this.pathLenConstraints.add(objectIdentifier); } }
Example 13
Source File: PolicyIssuerName.java From signer with GNU Lesser General Public License v3.0 | 4 votes |
@Override public void parse(ASN1Primitive primitive) { if (primitive instanceof DLSequence) { DLSequence sequence = (DLSequence) primitive; ASN1Encodable asn1Encodable = sequence.getObjectAt(0); if (asn1Encodable instanceof DERTaggedObject) { DERTaggedObject derTaggedObject = (DERTaggedObject) asn1Encodable; ASN1Primitive object = derTaggedObject.getObject(); if (object instanceof DEROctetString) { OctetString octetString = new OctetString(); octetString.parse(object); this.issuerName = octetString.getValueUTF8(); } else if (object instanceof DERSequence) { DERSequence sequence2 = (DERSequence) object; for (int i = 0; i < sequence2.size(); i++) { ASN1Encodable obj = sequence2.getObjectAt(i); if (obj instanceof DERSet) { DERSet set = (DERSet) obj; ASN1Encodable object2 = set.getObjectAt(0); if (object2 instanceof DERSequence) { DERSequence sequence3 = (DERSequence) object2; ObjectIdentifier objectIdendifier = new ObjectIdentifier(); objectIdendifier.parse(sequence3.getObjectAt(0).toASN1Primitive()); String name = null; ASN1Encodable object3 = sequence3.getObjectAt(1); if (object3 instanceof DERPrintableString) { name = ((DERPrintableString) object3).getString(); } else if (object3 instanceof DERUTF8String) { name = ((DERUTF8String) object3).getString(); } else { System.out.println(policyMessagesBundle.getString("error.not.recognized.object",object3.getClass(),object3.toString())); } if (this.issuerNames == null) { this.issuerNames = new HashMap<ObjectIdentifier, String>(); } this.issuerNames.put(objectIdendifier, name); } } } } } } }