Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
178 views
in Technique[技术] by (71.8m points)

java - Policy Identifier for Certificate Policies in X509 Attribute Certificate using Bouncy Castle C#

Hi I am developing C# code for generating X509 Attribute Certificate using Bouncy Castle (C#). I need to add certificate policies(2.5.29.32) extension with certain values. I am able to add the Policy Identifiers (CPS and Unotice) but some how not the Policy Identifier. Below is the expect and achieved so for.

expected:

OBJECT IDENTIFIER 2.5.29.32 certificatePolicies (X.509 extension)

    OCTET STRING (88 byte) 3056305406022A03304E301C06082B060105050702011610687474703A2F2F6C6F6361…
      SEQUENCE (1 elem)
        SEQUENCE (2 elem)
          OBJECT IDENTIFIER 1.2.3 //this is missing in my certificate
          SEQUENCE (2 elem)
            SEQUENCE (2 elem)
              OBJECT IDENTIFIER 1.3.6.1.5.5.7.2.1 cps (PKIX policy qualifier)
              IA5String http://localhost
            SEQUENCE (2 elem)
              OBJECT IDENTIFIER 1.3.6.1.5.5.7.2.2 unotice (PKIX policy qualifier)
              SEQUENCE (1 elem)
                UTF8String TCG Trusted Platform Endorsement

achieved:

OBJECT IDENTIFIER 2.5.29.32 certificatePolicies (X.509 extension)

    OCTET STRING (81 byte) 301D301B06082B06010505070201300F160D7777772E64656C6C20496E632E3030302E…
      SEQUENCE (1 elem)
        SEQUENCE (2 elem)
          OBJECT IDENTIFIER 1.3.6.1.5.5.7.2.1 cps (PKIX policy qualifier)
          SEQUENCE (1 elem)
            IA5String www.
      SEQUENCE (1 elem)
        SEQUENCE (2 elem)
          OBJECT IDENTIFIER 1.3.6.1.5.5.7.2.2 unotice (PKIX policy qualifier)
          SEQUENCE (1 elem)
            UTF8String TCG Trusted Platform Endorsement 

Can someone help me to achieve the expected?

Thankyou.

question from:https://stackoverflow.com/questions/65875044/policy-identifier-for-certificate-policies-in-x509-attribute-certificate-using-b

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...