ICrypto interface
Interface for crypto functions used by library
Methods
| base64Decode(string) | base64 decode string |
| base64Encode(string) | base64 Encode string |
| base64Url |
base64 URL safe encoded string |
| clear |
Removes all cryptographic keys from IndexedDB storage |
| create |
Creates a guid randomly. |
| encode |
Stringifies and base64Url encodes input public key |
| get |
Generates an JWK RSA S256 Thumbprint |
| hash |
Returns the SHA-256 hash of an input string |
| remove |
Removes cryptographic keypair from key store matching the keyId passed in |
| sign |
Returns a signed proof-of-possession token with a given acces token that contains a cnf claim with the required kid. |
Method Details
base64Decode(string)
base64 decode string
function base64Decode(input: string): string
Parameters
- input
-
string
Returns
string
base64Encode(string)
base64 Encode string
function base64Encode(input: string): string
Parameters
- input
-
string
Returns
string
base64UrlEncode(string)
base64 URL safe encoded string
function base64UrlEncode(input: string): string
Parameters
- input
-
string
Returns
string
clearKeystore()
Removes all cryptographic keys from IndexedDB storage
function clearKeystore(): Promise<boolean>
Returns
Promise<boolean>
createNewGuid()
Creates a guid randomly.
function createNewGuid(): string
Returns
string
encodeKid(string)
Stringifies and base64Url encodes input public key
function encodeKid(inputKid: string): string
Parameters
- inputKid
-
string
Returns
string
Base64Url encoded public key
getPublicKeyThumbprint(SignedHttpRequestParameters)
Generates an JWK RSA S256 Thumbprint
function getPublicKeyThumbprint(request: SignedHttpRequestParameters): Promise<string>
Parameters
- request
- SignedHttpRequestParameters
Returns
Promise<string>
hashString(string)
Returns the SHA-256 hash of an input string
function hashString(plainText: string): Promise<string>
Parameters
- plainText
-
string
Returns
Promise<string>
removeTokenBindingKey(string)
Removes cryptographic keypair from key store matching the keyId passed in
function removeTokenBindingKey(kid: string): Promise<void>
Parameters
- kid
-
string
Returns
Promise<void>
signJwt(SignedHttpRequest, string, ShrOptions, string)
Returns a signed proof-of-possession token with a given acces token that contains a cnf claim with the required kid.
function signJwt(payload: SignedHttpRequest, kid: string, shrOptions?: ShrOptions, correlationId?: string): Promise<string>
Parameters
- payload
- SignedHttpRequest
- kid
-
string
- shrOptions
- ShrOptions
- correlationId
-
string
Returns
Promise<string>