public RecoverableSerialForm(PkiCertificateSigningRequest csr)
 {
     _subject   = csr.SubjectName;
     _keypair   = new PkiKeyPair.RecoverableSerialForm(csr._keyPair);
     _hashalgor = csr.HashAlgorithm;
     _exts      = csr.CertificateExtensions.Select(x =>
                                                   (x.Identifier.Id, x.IsCritical,
                                                    x.Value.ToAsn1Object().GetDerEncoded())).ToArray();
 }
Beispiel #2
0
            public PkiCertificateSigningRequest Recover()
            {
                var csr = new PkiCertificateSigningRequest(_subject, _keypair?.Recover(), _hashalgor);

                foreach (var e in _exts)
                {
                    csr.CertificateExtensions.Add(new PkiCertificateExtension
                    {
                        Identifier = new DerObjectIdentifier(e.id),
                        IsCritical = e.crit,
                        Value      = Asn1Object.FromByteArray(e.value),
                    });
                }

                return(csr);
            }