Skip to content

Commit 017d92e

Browse files
authored
DSA --> RSA (#4504)
* dsa --> rsa * revert snippets that are about dsa * remove signaturedescription example * remove checkreturnvalue_detached example
1 parent f2f5975 commit 017d92e

File tree

11 files changed

+34
-1304
lines changed

11 files changed

+34
-1304
lines changed

samples/snippets/cpp/VS_Snippets_CLR_System/system.Security.Cryptography.SignatureDescription/CPP/signaturedescription.cpp

Lines changed: 0 additions & 185 deletions
This file was deleted.

samples/snippets/cpp/VS_Snippets_CLR_System/system.Security.Cryptography.XML.SignedXML_CheckReturnValue_Detached/CPP/exampledetached.cpp

Lines changed: 0 additions & 155 deletions
This file was deleted.

samples/snippets/cpp/VS_Snippets_CLR_System/system.Security.Cryptography.XML.SignedXML_CheckReturnValue_Envelope/CPP/exampleenvelope.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ using namespace System::Xml;
1717

1818
// <Snippet2>
1919
// Sign an XML file and save the signature in a new file.
20-
void SignXmlFile( String^ FileName, String^ SignedFileName, DSA^ DSAKey )
20+
void SignXmlFile( String^ FileName, String^ SignedFileName, RSA^ RSAKey )
2121
{
2222

2323
// Create a new XML document.
@@ -32,8 +32,8 @@ void SignXmlFile( String^ FileName, String^ SignedFileName, DSA^ DSAKey )
3232
// Create a SignedXml object.
3333
SignedXml^ signedXml = gcnew SignedXml( doc );
3434

35-
// Add the DSA key to the SignedXml document.
36-
signedXml->SigningKey = DSAKey;
35+
// Add the RSA key to the SignedXml document.
36+
signedXml->SigningKey = RSAKey;
3737

3838
// Create a reference to be signed.
3939
Reference^ reference = gcnew Reference;
@@ -46,9 +46,9 @@ void SignXmlFile( String^ FileName, String^ SignedFileName, DSA^ DSAKey )
4646
// Add the reference to the SignedXml object.
4747
signedXml->AddReference( reference );
4848

49-
// Add a DSAKeyValue to the KeyInfo (optional; helps recipient find key to validate).
49+
// Add a RSAKeyValue to the KeyInfo (optional; helps recipient find key to validate).
5050
KeyInfo^ keyInfo = gcnew KeyInfo;
51-
keyInfo->AddClause( gcnew DSAKeyValue( safe_cast<DSA^>(DSAKey) ) );
51+
keyInfo->AddClause( gcnew RSAKeyValue( safe_cast<RSA^>(RSAKey) ) );
5252
signedXml->KeyInfo = keyInfo;
5353

5454
// Compute the signature.
@@ -133,16 +133,16 @@ int main()
133133
try
134134
{
135135

136-
// Generate a DSA signing key.
137-
DSA^ DSAKey = DSA::Create();
136+
// Generate a RSA signing key.
137+
RSA^ RSAKey = RSA::Create();
138138

139139
// Create an XML file to sign.
140140
CreateSomeXml( "Example.xml" );
141141
Console::WriteLine( "New XML file created." );
142142

143143
// Sign the XML that was just created and save it in a
144144
// new file.
145-
SignXmlFile( "Example.xml", "SignedExample.xml", DSAKey );
145+
SignXmlFile( "Example.xml", "SignedExample.xml", RSAKey );
146146
Console::WriteLine( "XML file signed." );
147147

148148
// Verify the signature of the signed XML.

0 commit comments

Comments
 (0)