다음을 통해 공유


IVsStrongNameKeys2.CreateNewKeyWithNameAndSpecifiedSignatureAlgorithm Method

Definition

Creates a new key using a specified Signature Algorithm to be used for signing, exporting to a file, and creating a new key container.

public:
 int CreateNewKeyWithNameAndSpecifiedSignatureAlgorithm(System::String ^ pszAlgorithmID, System::UInt32 dwKeyLength, System::String ^ szFile, System::String ^ szPassword, System::String ^ szSubjectName);
public:
 int CreateNewKeyWithNameAndSpecifiedSignatureAlgorithm(Platform::String ^ pszAlgorithmID, unsigned int dwKeyLength, Platform::String ^ szFile, Platform::String ^ szPassword, Platform::String ^ szSubjectName);
int CreateNewKeyWithNameAndSpecifiedSignatureAlgorithm(std::wstring const & pszAlgorithmID, unsigned int dwKeyLength, std::wstring const & szFile, std::wstring const & szPassword, std::wstring const & szSubjectName);
public int CreateNewKeyWithNameAndSpecifiedSignatureAlgorithm (string pszAlgorithmID, uint dwKeyLength, string szFile, string szPassword, string szSubjectName);
abstract member CreateNewKeyWithNameAndSpecifiedSignatureAlgorithm : string * uint32 * string * string * string -> int
Public Function CreateNewKeyWithNameAndSpecifiedSignatureAlgorithm (pszAlgorithmID As String, dwKeyLength As UInteger, szFile As String, szPassword As String, szSubjectName As String) As Integer

Parameters

pszAlgorithmID
String

[in] The encryption algorithm identifier. If null is passed in for this parameter, the default SHA-256 algorithm is used.

dwKeyLength
UInt32

[in] The length of the encryption key. If zero (0) is passed in for this parameter, the system default key length is used.

szFile
String

[in] The file in which to store the encryption key.

szPassword
String

[in] The password for the key being generated.

szSubjectName
String

[in] The name that goes after “CN=” in the certificate name.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

This member only supports specifying those cryptographic algorithms for which CRYPT_OBJID_BLOB is zero (see the CRYPT_ALGORITHM_IDENTIFIER structure for more information).

Applies to