SigningAlgorithm Property

The algorithm used when signing.

Syntax

ANSI (Cross Platform)
int GetSigningAlgorithm();
int SetSigningAlgorithm(int iSigningAlgorithm); Unicode (Windows) INT GetSigningAlgorithm();
INT SetSigningAlgorithm(INT iSigningAlgorithm);

Possible Values

SA_HS256(0), 
SA_HS384(1),
SA_HS512(2),
SA_RS256(3),
SA_RS384(4),
SA_RS512(5),
SA_ES256(6),
SA_ES384(7),
SA_ES512(8),
SA_PS256(9),
SA_PS384(10),
SA_PS512(11),
SA_NONE(12),
SA_ES256K(13)
@property (nonatomic,readwrite,assign,getter=signingAlgorithm,setter=setSigningAlgorithm:) int signingAlgorithm;
- (int)signingAlgorithm;
- (void)setSigningAlgorithm:(int)newSigningAlgorithm;

Possible Values

SA_HS256(0), 
SA_HS384(1),
SA_HS512(2),
SA_RS256(3),
SA_RS384(4),
SA_RS512(5),
SA_ES256(6),
SA_ES384(7),
SA_ES512(8),
SA_PS256(9),
SA_PS384(10),
SA_PS512(11),
SA_NONE(12),
SA_ES256K(13)
#define PID_JWT_SIGNINGALGORITHM 37

IPWORKSAUTH_EXTERNAL void* IPWORKSAUTH_CALL IPWorksAuth_JWT_Get(void *lpObj, int propid, int arridx, int *lpcbVal, int64 *lpllVal);
IPWORKSAUTH_EXTERNAL int IPWORKSAUTH_CALL IPWorksAuth_JWT_Set(void *lpObj, int propid, int arridx, const void *val, int cbVal);

Default Value

0

Remarks

This property specifies the algorithm to use when signing.

When signing with an HMAC algorithm Key must be specified. When an RSA or ECDSA algorithm is selected Certificate must be set before calling Sign and SignerCert must be set before calling Verify. The following values are supported:

AlgorithmDescriptionPrivate Key Location
0 (saHS256 - default) HMAC using SHA-256 Key
1 (saHS384) HMAC using SHA-384 Key
2 (saHS512) HMAC using SHA-512 Key
3 (saRS256) RSASSA-PKCS1-v1_5 using SHA-256 Certificate
4 (saRS384) RSASSA-PKCS1-v1_5 using SHA-384 Certificate
5 (saRS512) RSASSA-PKCS1-v1_5 using SHA-512 Certificate
6 (saPS256) RSASSA-PSS using SHA-256 and MGF1 with SHA-256 Certificate
7 (saPS384) RSASSA-PSS using SHA-384 and MGF1 with SHA-384 Certificate
8 (saPS512) RSASSA-PSS using SHA-512 and MGF1 with SHA-512 Certificate
9 (saES256) ECDSA using P-256 and SHA-256 Certificate
10 (saES384) ECDSA using P-384 and SHA-384 Certificate
11 (saES512) ECDSA using P-521 and SHA-512 Certificate
12 (saNone) None (unprotected) Not Applicable
13 (saES256K) ECDSA using secp256k1 curve and SHA-256 Certificate

Note: This setting is also applicable when StrictValidation is enabled before calling Verify.

Data Type

Integer

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Auth 2020 C++ Edition - Version 20.0 [Build 8155]