/** * create an AuthorityInformationAccess with the oid and location provided. */ public AuthorityInformationAccess( DERObjectIdentifier oid, GeneralName location) { accessMethod = oid; accessLocation = location; }
public static CipherParameters generateCipherParameters( DERObjectIdentifier algorithmOID, char[] password, ASN1Encodable pbeParameters) { return(generateCipherParameters(algorithmOID.getId(), password, pbeParameters)); }
public AlgorithmIdentifier( DERObjectIdentifier objectId, ASN1Encodable parameters) { this.objectId = objectId; this.parameters = parameters; }
/** * Apply default coversion for the given value depending on the oid * and the character range of the value. * * @param oid the object identifier for the DN entry * @param value the value associated with it * @return the ASN.1 equivalent for the string value. */ public override ASN1Object getConvertedValue( DERObjectIdentifier oid, string value) { if (value.Length != 0 && value[0] == '#') { try { return(convertHexEncoded(value, 1)); } catch (IOException) { throw new Exception("can't recode value for oid " + oid.getId()); } } else if (oid.Equals(X509Name.EmailAddress)) { return(new DERIA5String(value)); } else if (canBePrintable(value)) { return(new DERPrintableString(value)); } else if (canBeUTF8(value)) { return(new DERUTF8String(value)); } return(new DERBMPString(value)); }
/** * returns a vector with 0 or more objects of all the capabilities * matching the passed in capability OID. If the OID passed is null the * entire set is returned. */ public ArrayList getCapabilities( DERObjectIdentifier capability) { IEnumerator e = capabilities.getObjects(); ArrayList list = new ArrayList(); if (capability == null) { while (e.MoveNext()) { SMIMECapability cap = SMIMECapability.getInstance(e.Current); list.Add(cap); } } else { while (e.MoveNext()) { SMIMECapability cap = SMIMECapability.getInstance(e.Current); if (capability.Equals(cap.getCapabilityID())) { list.Add(cap); } } } return(list); }
/// <summary> /// Get any critical extensions. /// </summary> /// <returns>A sorted list of critical entension.</returns> public SortedList getCriticalExtensionOIDs() { if (xStruct.getVersion() == 3) { SortedList set = new SortedList(); X509Extensions extensions = xStruct.getTBSCertificate().getExtensions(); if (extensions != null) { IEnumerator e = extensions.oids(); while (e.MoveNext()) { DERObjectIdentifier oid = (DERObjectIdentifier)e.Current;; X509Extension ext = extensions.getExtension(oid); if (ext.isCritical()) { set.Add(oid.getId(), ext); } } return(set); } } return(null); }
public OtherRecipientInfo( DERObjectIdentifier oriType, ASN1Encodable oriValue) { this.oriType = oriType; this.oriValue = oriValue; }
public SMIMECapability( DERObjectIdentifier capabilityID, ASN1Encodable parameters) { this.capabilityID = capabilityID; this.parameters = parameters; }
public Attribute( DERObjectIdentifier attrType, ASN1Set attrValues) { this.attrType = attrType; this.attrValues = attrValues; }
public OtherKeyAttribute( DERObjectIdentifier keyAttrId, ASN1Encodable keyAttr) { this.keyAttrId = keyAttrId; this.keyAttr = keyAttr; }
public override ASN1Object toASN1Object() { ASN1EncodableVector vec = new ASN1EncodableVector(); IEnumerator e = ordering.GetEnumerator(); while (e.MoveNext()) { DERObjectIdentifier oid = (DERObjectIdentifier)e.Current; X509Extension ext = (X509Extension)extensions[oid]; ASN1EncodableVector v = new ASN1EncodableVector(); v.add(oid); if (ext.isCritical()) { v.add(new DERBoolean(true)); } v.add(ext.getValue()); vec.add(new DERSequence(v)); } return(new DERSequence(vec)); }
public KeySpecificInfo( DERObjectIdentifier algorithm, ASN1OctetString counter) { this.algorithm = algorithm; this.counter = counter; }
public CertBag( ASN1Sequence seq) { this.seq = seq; this.certId = (DERObjectIdentifier)seq.getObjectAt(0); this.certValue = ((DERTaggedObject)seq.getObjectAt(1)).getObject(); }
/** * Constructor from a table of extensions with ordering. * <p> * It's is assumed the table contains OID/String pairs. */ public X509Extensions( ArrayList ordering, Hashtable extensions) { IEnumerator e; if (ordering == null) { e = extensions.Keys.GetEnumerator(); } else { e = ordering.GetEnumerator(); } while (e.MoveNext()) { this.ordering.Add(e.Current); } e = this.ordering.GetEnumerator(); while (e.MoveNext()) { DERObjectIdentifier oid = (DERObjectIdentifier)e.Current; X509Extension ext = (X509Extension)extensions[oid]; this.extensions.Add(oid, ext); } }
public CertBag( DERObjectIdentifier certId, ASN1Object certValue) { this.certId = certId; this.certValue = certValue; }
public X9FieldID( DERObjectIdentifier id, BigInteger primeP) { this.id = id; this.parameters = new DERInteger(primeP); }
public PolicyInformation( DERObjectIdentifier policyIdentifier, ASN1Sequence policyQualifiers) { this.policyIdentifier = policyIdentifier; this.policyQualifiers = policyQualifiers; }
public static ASN1Encodable generateAlgorithmParameters( DERObjectIdentifier algorithmOID, byte[] salt, int iterationCount) { return(generateAlgorithmParameters(algorithmOID.getId(), salt, iterationCount)); }
public ContentInfo( DERObjectIdentifier contentType, ASN1Encodable content) { this.contentType = contentType; this.content = content; }
public ResponseBytes( DERObjectIdentifier responseType, ASN1OctetString response) { this.responseType = responseType; this.response = response; }
public SafeBag( DERObjectIdentifier oid, ASN1Object obj) { this.bagId = oid; this.bagValue = obj; this.bagAttributes = null; }
public SafeBag( DERObjectIdentifier oid, ASN1Object obj, ASN1Set bagAttributes) { this.bagId = oid; this.bagValue = obj; this.bagAttributes = bagAttributes; }
public EncryptedContentInfo( DERObjectIdentifier contentType, AlgorithmIdentifier contentEncryptionAlgorithm, ASN1OctetString encryptedContent) { this.contentType = contentType; this.contentEncryptionAlgorithm = contentEncryptionAlgorithm; this.encryptedContent = encryptedContent; }
public static EncryptedPrivateKeyInfo createEncryptedPrivateKeyInfo( DERObjectIdentifier algorithm, char[] passPhrase, byte[] salt, int iterationCount, AsymmetricKeyParameter key) { return(createEncryptedPrivateKeyInfo(algorithm.getId(), passPhrase, salt, iterationCount, PrivateKeyInfoFactory.createPrivateKeyInfo(key))); }
/// <summary> /// Add and extension to this certificate. /// </summary> /// <param name="OID">The object identifier.</param> /// <param name="critical">Is it critical.</param> /// <param name="value">byte[] containing the value of this extension.</param> public void addExtension(DERObjectIdentifier OID, bool critical, byte[] value) { if (extensions == null) { extensions = new Hashtable(); extOrdering = new ArrayList(); } extensions[OID] = new X509Extension(critical, new DEROctetString(value)); extOrdering.Add(OID); }
/// <summary> /// Return the value for a given OID. /// </summary> /// <param name="ident">The oid of the entry.</param> /// <returns>The string representation of the value.</returns> public ASN1Object getRDN(DERObjectIdentifier ident) { int i = ordering.IndexOf(ident); if (i == -1) { return(null); } return((ASN1Object)values[i]); }
public KeySpecificInfo( ASN1Sequence seq) { IEnumerator e = seq.getObjects(); e.MoveNext(); algorithm = (DERObjectIdentifier)e.Current; e.MoveNext(); counter = (ASN1OctetString)e.Current; }
public PolicyInformation( ASN1Sequence seq) { policyIdentifier = (DERObjectIdentifier)seq.getObjectAt(0); if (seq.size() > 1) { policyQualifiers = (ASN1Sequence)seq.getObjectAt(1); } }
public SMIMECapability( ASN1Sequence seq) { capabilityID = (DERObjectIdentifier)seq.getObjectAt(0); if (seq.size() > 1) { parameters = (ASN1Object)seq.getObjectAt(1); } }
public SafeBag( ASN1Sequence seq) { this.bagId = (DERObjectIdentifier)seq.getObjectAt(0); this.bagValue = ((DERTaggedObject)seq.getObjectAt(1)).getObject(); if (seq.size() == 3) { this.bagAttributes = (ASN1Set)seq.getObjectAt(2); } }