using System.Collections; namespace Org.BouncyCastle.Asn1.X509 { /** * PolicyMappings V3 extension, described in RFC3280. *
	 *    PolicyMappings ::= Sequence SIZE (1..MAX) OF Sequence {
	 *      issuerDomainPolicy      CertPolicyId,
	 *      subjectDomainPolicy     CertPolicyId }
	 * 
* * @see RFC 3280, section 4.2.1.6 */ public class PolicyMappings : Asn1Encodable { private readonly Asn1Sequence seq; /** * Creates a new PolicyMappings instance. * * @param seq an Asn1Sequence constructed as specified * in RFC 3280 */ public PolicyMappings( Asn1Sequence seq) { this.seq = seq; } #if !(SILVERLIGHT || PORTABLE) public PolicyMappings( Hashtable mappings) : this((IDictionary)mappings) { } #endif /** * Creates a new PolicyMappings instance. * * @param mappings a HashMap value that maps * string oids * to other string oids. */ public PolicyMappings( IDictionary mappings) { Asn1EncodableVector v = new Asn1EncodableVector(); foreach (string idp in mappings.Keys) { string sdp = (string) mappings[idp]; v.Add( new DerSequence( new DerObjectIdentifier(idp), new DerObjectIdentifier(sdp))); } seq = new DerSequence(v); } public override Asn1Object ToAsn1Object() { return seq; } } }