public static DecryptKey FromPem(string pem)
        {
            var parser = new DecryptKeyParser(pem);

            parser.Decode();

            return(parser.GetContent());
        }
Esempio n. 2
0
 protected DecryptKey(DecryptKeyParser parser)
 {
     SchemeVersion          = parser.GetSchemeVersion();
     SchemeKeyVersion       = parser.GetSchemeKeyVersion();
     Recipient              = parser.GetRecipient();
     RecipientKeySetVersion = parser.GetRecipientKeySetVersion();
     PrivateKey             = parser.GetPrivateKey();
     publicKey              = parser.GetPublicKey();
 }
Esempio n. 3
0
        private static DecryptKey FromPem(string pem)
        {
            var parser = new DecryptKeyParser(pem);

            parser.Decode();
            switch (parser.GetDecryptKeyType().Name)
            {
            case DecryptKeyType.IdentityDecryptionName:
                return(new IdentityDecryptKey(parser));

            case DecryptKeyType.PseudonymDecryptionName:
                return(new PseudonymDecryptKey(parser));

            case DecryptKeyType.PseudonymClosingName:
                return(new PseudonymClosingKey(parser));

            default:
                throw new PolymorphicPseudonymisationException($"Unknown type {parser.GetDecryptKeyType().Name}");
            }
        }
 public IdentityDecryptKey(DecryptKeyParser parser) : base(parser)
 {
 }
Esempio n. 5
0
 protected internal PseudonymClosingKey(DecryptKeyParser parser) : base(parser)
 {
 }
Esempio n. 6
0
        public static DecryptKey FromPem(string pem)
        {
            var parser = new DecryptKeyParser();

            return(parser.Decode(pem));
        }
 public PseudonymDecryptKey(DecryptKeyParser parser) : base(parser)
 {
 }