Sign() public static method

public static Sign ( byte privateKey, Stream stream ) : byte[]
privateKey byte
stream Stream
return byte[]
コード例 #1
0
        internal Certificate(DigitalSignature digitalSignature, Stream stream)
        {
            if (digitalSignature == null)
            {
                throw new ArgumentNullException("digitalSignature");
            }

            byte[] signature;

            if (digitalSignature.DigitalSignatureAlgorithm == DigitalSignatureAlgorithm.EcDsaP521_Sha256)
            {
                signature = EcDsaP521_Sha256.Sign(digitalSignature.PrivateKey, stream);
            }
            else if (digitalSignature.DigitalSignatureAlgorithm == DigitalSignatureAlgorithm.Rsa2048_Sha256)
            {
                signature = Rsa2048_Sha256.Sign(digitalSignature.PrivateKey, stream);
            }
            else
            {
                return;
            }

            this.Nickname = digitalSignature.Nickname;
            this.DigitalSignatureAlgorithm = digitalSignature.DigitalSignatureAlgorithm;
            this.PublicKey = digitalSignature.PublicKey;
            this.Signature = signature;
        }