IVsStrongNameKeys2.CreateNewKeyWithNameAndSpecifiedSignatureAlgorithm 方法

定义

使用要用于签名、导出到文件和创建新的密钥容器的指定签名算法创建新密钥。

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

参数

pszAlgorithmID
String

中加密算法标识符。 如果为此参数传递了 null,则使用默认的 SHA-256 算法。

dwKeyLength
UInt32

中加密密钥的长度。 如果为此参数传入 0 (0) ,则使用系统默认的密钥长度。

szFile
String

中要存储加密密钥的文件。

szPassword
String

中正在生成的密钥的密码。

szSubjectName
String

中证书名称中的 "CN =" 后的名称。

返回

Int32

如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。

注解

此成员仅支持指定 CRYPT_OBJID_BLOB 为零的那些加密算法 (有关详细) 信息,请参阅 CRYPT_ALGORITHM_IDENTIFIER 结构。

适用于