abla/crypto/rsapss

Generated from source.

Import with import "abla/crypto/rsapss".

Source: abla/crypto/rsapss/entry.ab

RsaPssHash (class)

class RsaPssHash(val size: int, val hash: (string) -> string)

Pairs a message-digest function with the digest size used for RSA-PSS.

rsaPssHash (fun)

fun rsaPssHash(bits: int): RsaPssHash?

SHA-256, SHA-384 or SHA-512 by its bit length, or null.

rsaPssEncode (fun)

fun rsaPssEncode(emBits: int, mHash: string, salt: string, hash: (string) -> string, hashSize: int): string

EMSA-PSS-ENCODE: the encoded message of emBits bits (the modulus's length less one) for mHash and salt, or "" when the key is too small for this hash and salt.

rsaPssCheck (fun)

fun rsaPssCheck(emBits: int, em: string, mHash: string, saltLength: int, hash: (string) -> string,
    hashSize: int): bool

EMSA-PSS-VERIFY on the emLen bytes em.

rsaPssSignWithSalt (fun)

trusted fun rsaPssSignWithSalt(key: RsaPrivateKey, hashBits: int, message: string, salt: string): CryptoResult

The signature of message under key with the salt given (fresh random bytes, the hash's length for TLS 1.3). It is here for known-answer tests; use signPss* for a random one.

rsaPssSign (fun)

trusted fun rsaPssSign(key: RsaPrivateKey, hashBits: int, message: string, saltLength: int? = null): CryptoResult

RSASSA-PSS with a random salt of saltLength bytes (the hash's length when null) and SHA-256, -384 or -512.

RsaPrivateKey.signPssSha256 (extension fun)

trusted fun RsaPrivateKey.signPssSha256(message: string): CryptoResult

Returns an RSA-PSS signature with SHA-256 and a digest-length random salt, or an error for an invalid key or unavailable randomness.

RsaPrivateKey.signPssSha384 (extension fun)

trusted fun RsaPrivateKey.signPssSha384(message: string): CryptoResult

Returns an RSA-PSS signature with SHA-384 and a digest-length random salt, or an error for an invalid key or unavailable randomness.

RsaPrivateKey.signPssSha512 (extension fun)

trusted fun RsaPrivateKey.signPssSha512(message: string): CryptoResult

Returns an RSA-PSS signature with SHA-512 and a digest-length random salt, or an error for an invalid key or unavailable randomness.

rsaPssVerify (fun)

fun rsaPssVerify(key: RsaPublicKey, hashBits: int, message: string, signature: string, saltLength: int? = null): bool

Whether signature is a valid RSASSA-PSS signature of message: the hash and MGF1's are the same, and the salt has saltLength bytes (the hash's length when null). Verification is public and takes variable time.

RsaPublicKey.verifyPssSha256 (extension fun)

fun RsaPublicKey.verifyPssSha256(message: string, signature: string): bool

Returns whether the signature matches the message under RSA-PSS with SHA-256 and a digest-length salt.

RsaPublicKey.verifyPssSha384 (extension fun)

fun RsaPublicKey.verifyPssSha384(message: string, signature: string): bool

Returns whether the signature matches the message under RSA-PSS with SHA-384 and a digest-length salt.

RsaPublicKey.verifyPssSha512 (extension fun)

fun RsaPublicKey.verifyPssSha512(message: string, signature: string): bool

Returns whether the signature matches the message under RSA-PSS with SHA-512 and a digest-length salt.

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.