Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test compilation
  • Loading branch information
vcsjones authored Jun 22, 2021
commit 7a5a8ea67c016134d58eb93ca21bad83f5176ee6
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ internal static (X509Certificate2 certificate, X509Certificate2Collection) Gener
intermedPub3.Dispose();
CertificateAuthority intermediateAuthority3 = new CertificateAuthority(intermedCert3, null, null, null);

RSA eeKey = (RSA)endEntity.PrivateKey;
RSA eeKey = endEntity.GetRSAPrivateKey();
endEntity = intermediateAuthority3.CreateEndEntity(
$"CN=\"A SSL Test\", O=\"testName\"",
eeKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ internal void VerifySimpleDecrypt(byte[] encodedMessage, CertLoader certLoader,
using (X509Certificate2 pubCert = certLoader.GetCertificate())
{
RecipientInfo recipient = ecms.RecipientInfos.Cast<RecipientInfo>().Where((r) => r.RecipientIdentifier.MatchesCertificate(cert)).Single();
ecms.Decrypt(recipient, cert.PrivateKey);
ecms.Decrypt(recipient, cert.GetRSAPrivateKey());
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ public void DigestValue_CRLF()

X509Certificate2 cert = new X509Certificate2(_pkcs12, "mono");
SignedXml signedXml = new SignedXml(doc);
signedXml.SigningKey = cert.PrivateKey;
signedXml.SigningKey = cert.GetRSAPrivateKey();
signedXml.SignedInfo.CanonicalizationMethod = SignedXml.XmlDsigExcC14NTransformUrl;
signedXml.SignedInfo.SignatureMethod = SignedXml.XmlDsigRSASHA1Url;

Expand Down Expand Up @@ -725,7 +725,7 @@ public void DigestValue_LF()

X509Certificate2 cert = new X509Certificate2(_pkcs12, "mono");
SignedXml signedXml = new SignedXml(doc);
signedXml.SigningKey = cert.PrivateKey;
signedXml.SigningKey = cert.GetRSAPrivateKey();
signedXml.SignedInfo.SignatureMethod = SignedXml.XmlDsigRSASHA1Url;
signedXml.SignedInfo.CanonicalizationMethod = SignedXml.XmlDsigExcC14NTransformUrl;

Expand Down Expand Up @@ -970,7 +970,7 @@ static XmlDocument CreateSignedXml(X509Certificate2 cert, string canonicalizatio
XmlDocument doc = CreateSomeXml(lineFeed);

SignedXml signedXml = new SignedXml(doc);
signedXml.SigningKey = cert.PrivateKey;
signedXml.SigningKey = cert.GetRSAPrivateKey();
signedXml.SignedInfo.CanonicalizationMethod = canonicalizationMethod;
signedXml.SignedInfo.SignatureMethod = SignedXml.XmlDsigRSASHA1Url;

Expand Down