Ejemplo n.º 1
0
        public static void AddEndEntityCertificateToStorage(Certificate certificate, byte[] certificateHash, byte[] encodedCert)
        {
            EndEntityCertificateEntry endEntityCertificateEntry = new EndEntityCertificateEntry();

            endEntityCertificateEntry.CertificateValue = encodedCert;
            endEntityCertificateEntry.IsRevoked        = false;
            byte[] endEntityCertificateEntrySerialized = SerializationUtil.Serialize(endEntityCertificateEntry);

            StorageUtil.saveToStorage(certificateHash, endEntityCertificateEntrySerialized);

            AddCertificateToCaIssuedCertificateList(certificate, certificateHash);
            AddCertificateToDomainCertificateList(certificate, certificateHash);
        }
Ejemplo n.º 2
0
        private static void MarkEndEntityCertificateRevokedInStore(byte[] certificateHash)
        {
            byte[] endEntityCertificateEntrySerialized = StorageUtil.readFromStorage(certificateHash);
            if (endEntityCertificateEntrySerialized == null)
            {
                return;
            }

            EndEntityCertificateEntry entityCertificateEntry = (EndEntityCertificateEntry)SerializationUtil.Deserialize(endEntityCertificateEntrySerialized);

            entityCertificateEntry.IsRevoked = true;

            endEntityCertificateEntrySerialized = SerializationUtil.Serialize(entityCertificateEntry);
            StorageUtil.saveToStorage(certificateHash, endEntityCertificateEntrySerialized);
        }