public CertificateOutputViewModel(byte[] signature, byte[] data, byte[] key, HashAlgorithmName hash,
                                          SymmetricAlgorithmName sym, SymmetricAlgorithmKey symKey, AsymmetricAlgorithmName alg,
                                          AsymmetricAlgorithmKey algKey, string file)
        {
            this.Description = "Certificate";

            this.EnvelopeData     = Convert.ToBase64String(data);
            this.EnvelopeCryptKey = key.ConvertToHex();
            this.Signature        = signature.ConvertToHex();

            this.Methods = new List <string>()
            {
                hash.ToString(),
                    sym.ToString(),
                    alg.ToString()
            };
            this.Method     = string.Join("\n", Methods);
            this.KeyLengths = new List <string>()
            {
                "",
                ((int)symKey).ToString("X"), // hex
                ((int)algKey).ToString("X")  // hex
            };
            this.KeyLength = string.Join("\n", KeyLengths);
            this.FileName  = file;
        }
示例#2
0
 public SignatureOutputViewModel(byte[] signature, HashAlgorithmName hash, AsymmetricAlgorithmName alg,
                                 AsymmetricAlgorithmKey algKey, string file)
 {
     this.Description = "Signature";
     this.Signature   = signature.ConvertToHex();
     this.Methods     = new List <string>()
     {
         hash.ToString(),
             alg.ToString()
     };
     this.Method     = string.Join("\n", Methods);
     this.KeyLengths = new List <string>()
     {
         "0A",
         ((int)algKey).ToString("X")  // hex
     };
     this.KeyLength = string.Join("\n", KeyLengths);
     this.FileName  = file;
 }