method PKCS7Sign(flags as Integer, InputData as string, SignKey as string, PrivateKey as String, PrivateKeyPassword as string, intermediaCertsData() as string, OutputBinary as boolean) as string
method PKCS7SignData(Certificate as X509MBS, PrivateKey as PKeyMBS, certs() as X509MBS = nil, data as string, flags as Integer = 0) as string
method VerifyData(data as string, Signature as string, Key as string, Password as string = "") as boolean
method VerifyData(data as string, Signature as string, Key as string, Password as string = "", Algorithm as Integer) as boolean
method VerifyRSAPSS(data as string, Signature as string, Key as string, Password as string = "", Algorithm as Integer, SaltLength as Integer = -1) as boolean
14 constants
Hash Algorithms
Constant
Value
Description
kAlgorithmSHA1
1
SHA 1.
kAlgorithmSHA224
2
SHA 2 with 224bit.
kAlgorithmSHA256
3
SHA 2 with 256bit.
kAlgorithmSHA384
4
SHA 2 with 384bit.
kAlgorithmSHA512
5
SHA 2 with 512bit.
Padding Options
Constant
Value
Description
kPaddingNone
3
Raw RSA encryption. This mode should only be used to implement cryptographically sound padding modes in the application code. Encrypting user data directly with RSA is insecure.
kPaddingPKCS1
1
PKCS #1 v1.5 padding. This currently is the most widely used mode.
kPaddingPKCS1OAEP
4
EME-OAEP as defined in PKCS #1 v2.0 with SHA-1, MGF1 and an empty encoding parameter. This mode is recommended for all new applications.
kPaddingSSLv23
2
PKCS #1 v1.5 padding with an SSL-specific modification that denotes that the server is SSL3 capable.
kPaddingX931
5
X931 padding.
PSS SaltLengths
Constant
Value
Description
kRSA_PSS_SALTLEN_AUTO
-2
Verify only: auto detect salt length.
kRSA_PSS_SALTLEN_AUTO_DIGEST_MAX
-4
Set salt length to maximum possible
kRSA_PSS_SALTLEN_DIGEST
-1
Salt length matches digest.
kRSA_PSS_SALTLEN_MAX
-3
Auto-detect on verify, set salt length to min(maximum possible, digest * length) on sign