Share via


AsymmetricSignatureProvider.ValidateAsymmetricSecurityKeySize Method

Definition

Validates that an asymmetric key size is of sufficient size for a SignatureAlgorithm.

public virtual void ValidateAsymmetricSecurityKeySize (Microsoft.IdentityModel.Tokens.SecurityKey key, string algorithm, bool willCreateSignatures);
abstract member ValidateAsymmetricSecurityKeySize : Microsoft.IdentityModel.Tokens.SecurityKey * string * bool -> unit
override this.ValidateAsymmetricSecurityKeySize : Microsoft.IdentityModel.Tokens.SecurityKey * string * bool -> unit
Public Overridable Sub ValidateAsymmetricSecurityKeySize (key As SecurityKey, algorithm As String, willCreateSignatures As Boolean)

Parameters

key
SecurityKey

The asymmetric key to validate.

algorithm
String

The algorithm for which this key will be used.

willCreateSignatures
Boolean

If true, the provider will be used for creating signatures.

Exceptions

Thrown if algorithm is null or empty.

Thrown if key.KeySize.KeySize is less than the minimum acceptable size.

Remarks

for minimum signing sizes. for minimum verifying sizes.

Applies to