EldoS | Feel safer!

Software components for data protection, secure storage and transfer

About ElCertificateRevocationList class some questions

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#8519
Posted: 12/23/2008 03:03:02
by  xu cong
This is my code:
Code
        TElCertificateRevocationList CertRevocationList = new TElCertificateRevocationList();
        TElX509Certificate TELX509 = new TElX509Certificate();
        TElX509Certificate certificate = new TElX509Certificate();

        CertRevocationList.LoadFromStream(loadCRLlist, 0);
        CertRevocationList.Extensions.Included = SBCRL.Unit.crlAuthorityKeyIdentifier | SBCRL.Unit.crlCRLNumber | SBCRL.Unit.crlReasonCode;
        CertRevocationList.NextUpdate = DateTime.Now.AddHours(24);
        TElAuthorityKeyIdentifierCRLExtension AuthorityKeyIdentifierCRLExtension = new TElAuthorityKeyIdentifierCRLExtension();
        AuthorityKeyIdentifierCRLExtension.Value = TELX509.Extensions.SubjectKeyIdentifier.Value;
        CertRevocationList.Extensions.AuthorityKeyIdentifier.Value = AuthorityKeyIdentifierCRLExtension.Value;

        int indexCert = CertRevocationList.Add(SBUtils.Unit.StrToUTF8(SerialNumber));
        
        CertRevocationList.Extensions.CRLNumber.Number = CertRevocationList.Count;

        CertRevocationList.SaveToStream(saveCRLlist, TELX509);


Now I can generate Certificate Revocation List, But has two questions:
1、How to add ReasonCode?
2、How to change(add) AuthorityKey Identifier?

I read in the documents to write
Quote

To add the certificate information to the CRL, use Items property of ElCertificateRevocationList.

But I had not found Items property in ElCertificateRevocationList.

Perhaps I am too stupid, do not find the method.
Please help me.
Thanks!
#8520
Posted: 12/23/2008 04:57:57
by Ken Ivanov (EldoS Corp.)

As C# does not support indexed properties, all such properties (e.g., "XXX") are mapped to the get_XXX() and set_XXX() methods. Please use get_Items() method to access particular TElRevocationItem objects.
#8521
Posted: 12/23/2008 05:17:55
by  xu cong
Yes,As you said,I'm use get_Items() set ReasonCode,the result is null.
Code
int ReasonCodeNomber=2;
int indexCert = CertRevocationList.Add(SBUtils.Unit.StrToUTF8(SerialNumber));
CertRevocationList.Extensions.get_Items(indexCert).ReasonCode.Reason= ReasonCodeNomber;


So,I am very puzzled.
#8522
Posted: 12/23/2008 05:35:02
by Ken Ivanov (EldoS Corp.)

Quote
Yes,As you said,I'm use get_Items() set ReasonCode,the result is null.

The result of what?

#8523
Posted: 12/23/2008 05:48:36
by  xu cong
The results did not change.

With the same
Code
int indexCert = CertRevocationList.Add(SBUtils.Unit.StrToUTF8(SerialNumber));
#8524
Posted: 12/23/2008 06:01:44
by Ken Ivanov (EldoS Corp.)

The results of *what*?

Would you be so kind to clarify the problem you are encountering so that we could help you?
#8525
Posted: 12/23/2008 06:58:04
by  xu cong
Code
TElCertificateRevocationList CertRevocationList = new TElCertificateRevocationList();
TElX509Certificate TELX509 = new TElX509Certificate();
TElX509Certificate certificate = new TElX509Certificate();

CertRevocationList.LoadFromStream(loadCRLlist, 0);
CertRevocationList.Extensions.Included = SBCRL.Unit.crlAuthorityKeyIdentifier | SBCRL.Unit.crlCRLNumber | SBCRL.Unit.crlReasonCode;
CertRevocationList.NextUpdate = DateTime.Now.AddHours(24);
TElAuthorityKeyIdentifierCRLExtension AuthorityKeyIdentifierCRLExtension = new TElAuthorityKeyIdentifierCRLExtension();
AuthorityKeyIdentifierCRLExtension.Value = TELX509.Extensions.SubjectKeyIdentifier.Value;
CertRevocationList.Extensions.AuthorityKeyIdentifier.Value = AuthorityKeyIdentifierCRLExtension.Value;

int ReasonCodeNomber=2;
int indexCert = CertRevocationList.Add(SBUtils.Unit.StrToUTF8(SerialNumber));
CertRevocationList.Extensions.get_Items(indexCert).ReasonCode.Reason= ReasonCodeNomber;
        
CertRevocationList.Extensions.CRLNumber.Number = CertRevocationList.Count;

CertRevocationList.SaveToStream(saveCRLlist, TELX509);


Results of the CRL did not ReasonCode properties.

#8536
Posted: 12/24/2008 05:33:32
by Jayanthi Rajoo (Standard support level)
Joined: 05/29/2007
Posts: 16

This is to use the api wrong reason?
We want to know,How to set up ReasonCode property?
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.

Reply

Statistics

Topic viewed 2254 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!