与充气城堡签名时的PKCS1填充

我有以下c#Bouncy Castle代码,可使用RSA / SHA512在C#中对某些数据进行签名。有谁能告诉我如何在此过程中应用Pkcs1填充?


using (var txtreader = new StringReader(File.ReadAllText(_certificatePath)))

{

    var keyPair = (AsymmetricCipherKeyPair)new PemReader(txtreader).ReadObject();


    var key = keyPair.Private as RsaPrivateCrtKeyParameters;

    ISigner sig = SignerUtilities.GetSigner("SHA512withRSA");

    sig.Init(true, key);


    sig.BlockUpdate(requestToSign, 0, requestToSign.Length);

    byte[] signature = sig.GenerateSignature();

}


哈士奇WWW
浏览 180回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP