Beispiel #1
0
        public void Encode_SHA512()
        {
            byte[] digestValue = new byte[64];
            byte[] result      = Pkcs1DigestInfo.Encode(HashAlgorithmName.SHA512, digestValue);

            CheckAsn1(result);
        }
        public void Example_Pkcs1DigestInfo()
        {
            byte[] dataToSign = Encoding.ASCII.GetBytes("Hello world");
            using SHA256 sha = SHA256.Create();
            byte[] hashToSign = sha.ComputeHash(dataToSign);

            byte[] digestInfo = Pkcs1DigestInfo.Encode(HashAlgorithmName.SHA256, hashToSign);

            SignUsingPkcs11(digestInfo);
        }