CoseSigner 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
CoseSigner(AsymmetricAlgorithm, HashAlgorithmName, CoseHeaderMap, CoseHeaderMap)
初始化 CoseSigner 類別的新執行個體。
public CoseSigner (System.Security.Cryptography.AsymmetricAlgorithm key, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.Cose.CoseHeaderMap? protectedHeaders = default, System.Security.Cryptography.Cose.CoseHeaderMap? unprotectedHeaders = default);
new System.Security.Cryptography.Cose.CoseSigner : System.Security.Cryptography.AsymmetricAlgorithm * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.Cose.CoseHeaderMap * System.Security.Cryptography.Cose.CoseHeaderMap -> System.Security.Cryptography.Cose.CoseSigner
Public Sub New (key As AsymmetricAlgorithm, hashAlgorithm As HashAlgorithmName, Optional protectedHeaders As CoseHeaderMap = Nothing, Optional unprotectedHeaders As CoseHeaderMap = Nothing)
參數
要用於簽署的私鑰。
- hashAlgorithm
- HashAlgorithmName
用來建立簽署哈希值的哈希演算法。
- protectedHeaders
- CoseHeaderMap
簽署時要附加至訊息的受保護標頭參數集合。
- unprotectedHeaders
- CoseHeaderMap
簽署時要附加至訊息之未受保護的標頭參數集合。
例外狀況
key
為 null
。
key
是 RSA,用來 CoseSigner(RSA, RSASignaturePadding, HashAlgorithmName, CoseHeaderMap, CoseHeaderMap) 指定簽章填補。
-或-
key
為不支持的類型。
-或-
protectedHeaders
包含具有 Algorithm 標籤的值,但值根據 key
和 hashAlgorithm
不正確。
-或-
unprotectedHeaders
指定具有標籤的值 Algorithm 。
備註
針對中的 CoseSign1Message登入作業, protectedHeaders
並使用 unprotectedHeaders
做為內容 (值區,而且只會使用) 層。 針對中的 CoseMultiSignMessage登入作業, protectedHeaders
並使用 unprotectedHeaders
作為簽章層的貯體。
適用於
CoseSigner(RSA, RSASignaturePadding, HashAlgorithmName, CoseHeaderMap, CoseHeaderMap)
初始化 CoseSigner 類別的新執行個體。
public CoseSigner (System.Security.Cryptography.RSA key, System.Security.Cryptography.RSASignaturePadding signaturePadding, System.Security.Cryptography.HashAlgorithmName hashAlgorithm, System.Security.Cryptography.Cose.CoseHeaderMap? protectedHeaders = default, System.Security.Cryptography.Cose.CoseHeaderMap? unprotectedHeaders = default);
new System.Security.Cryptography.Cose.CoseSigner : System.Security.Cryptography.RSA * System.Security.Cryptography.RSASignaturePadding * System.Security.Cryptography.HashAlgorithmName * System.Security.Cryptography.Cose.CoseHeaderMap * System.Security.Cryptography.Cose.CoseHeaderMap -> System.Security.Cryptography.Cose.CoseSigner
Public Sub New (key As RSA, signaturePadding As RSASignaturePadding, hashAlgorithm As HashAlgorithmName, Optional protectedHeaders As CoseHeaderMap = Nothing, Optional unprotectedHeaders As CoseHeaderMap = Nothing)
參數
- key
- RSA
要用於簽署的私鑰。
- signaturePadding
- RSASignaturePadding
簽署時要使用的填補模式。
- hashAlgorithm
- HashAlgorithmName
用來建立簽署哈希值的哈希演算法。
- protectedHeaders
- CoseHeaderMap
簽署時要附加至訊息的受保護標頭參數集合。
- unprotectedHeaders
- CoseHeaderMap
簽署時要附加至訊息之未受保護的標頭參數集合。
例外狀況
key
為 null
。
protectedHeaders
包含具有 Algorithm 標籤的值,但值根據 key
和 signaturePadding
hashAlgorithm
不正確。
-或-
unprotectedHeaders
指定具有標籤的值 Algorithm 。
備註
針對中的 CoseSign1Message登入作業, protectedHeaders
並使用 unprotectedHeaders
做為內容層的標頭參數。 針對中的 CoseMultiSignMessage登入作業, protectedHeaders
並使用 unprotectedHeaders
做為簽章層的標頭參數。