コード例 #1
0
            public EncryptedCertificateGen1(Region certificateRegion)
            {
                var container = ((ContainerRegion)certificateRegion).ProcessedRegions;

                this.signature          = Validator.ToBigInteger(((HexValueRegion)container["Signature"]).ToBytes());
                this.publicKeyRemainder = ((HexValueRegion)container["PublicKeyRemainder"]).ToBytes();
                this.certificationAuthorityReference = new CertificationAuthorityReference(container["CertificationAuthorityReference"]);
            }
コード例 #2
0
        public static Dictionary <CertificationAuthorityReference, RSAPublicKey> LoadGen1RSAPublicKeys()
        {
            Assembly assembly = typeof(Validator).GetTypeInfo().Assembly;
            string   name     = assembly.FullName.Split(',')[0] + ".EC_PK.bin";
            var      reader   = new BinaryReader(assembly.GetManifestResourceStream(name));

            var certificationAuthorityReference = new CertificationAuthorityReference(reader);
            var rsaPublicKey = new RSAPublicKey(reader);

            var rsaPublicKeys = new Dictionary <CertificationAuthorityReference, RSAPublicKey>();

            rsaPublicKeys.Add(certificationAuthorityReference, rsaPublicKey);

            return(rsaPublicKeys);
        }
コード例 #3
0
            public CertificateGen1(byte[] certificateData)
            {
                using (var reader = new CustomBinaryReader(new MemoryStream(certificateData)))
                {
                    this.profileIdentifier = Convert.ToInt32(reader.ReadByte());
                    this.certificationAuthorityReference = new CertificationAuthorityReference(reader);
                    this.holderAuthorisation             = reader.ReadBytes(7);

                    var timestamp = reader.ReadSInt32();
                    if (timestamp != 0xFFFFFFFF)
                    {
                        this.endOfValidity = DateTimeOffset.FromUnixTimeSeconds(timestamp);
                    }
                    else
                    {
                        this.endOfValidity = null;
                    };
                    this.holderReference = reader.ReadBytes(8);
                    this.publicKey       = new RSAPublicKey(reader);
                };
            }