type CredentialAssertion = { credentialId: string; signature: Uint8Array; webauthn: WebAuthnData; }; type WebAuthnData = { authenticatorData: Uint8Array; clientDataJSON: Uint8Array; }; type CredentialRequestOptionParameters = { credentialId?: string | undefined; challenge: Uint8Array; /** * The relying party identifier to use. */ rpId?: PublicKeyCredentialRequestOptions["rpId"] | undefined; userVerification?: PublicKeyCredentialRequestOptions["userVerification"] | undefined; }; type SignParameters = CredentialRequestOptionParameters & { /** * Credential request function. Useful for environments that do not support * the WebAuthn API natively (i.e. React Native or testing environments). * * @default window.navigator.credentials.get */ getFn?: ((options?: CredentialRequestOptions | undefined) => Promise) | undefined; }; /** * Signs a hash using a stored credential. If no credential is provided, * a prompt will be displayed for the user to select an existing credential * that was previously registered. * * @example * ```ts * import { credential } from './credential' * * const signature = await sign({ * credentialId: credential.id, * hash: '0x...', * }) * ``` */ declare function requestWebAuthnSignature(parameters: SignParameters): Promise; /** * Returns the request options to sign a hash using a stored credential * with a P256 public key. * * @example * ```ts * const options = getCredentialSignRequestOptions({ hash: '0x...' }) * const credentials = window.navigator.credentials.get(options) * ``` */ declare function getCredentialSignRequestOptions(parameters: CredentialRequestOptionParameters): CredentialRequestOptions; /** * @param signature * Parses an ASN.1 signature into a r and s value. * @return The signature as a Uint8Array. */ declare function parseAsn1Signature(signature: Uint8Array): Uint8Array; export { type CredentialAssertion, type CredentialRequestOptionParameters, type SignParameters, type WebAuthnData, getCredentialSignRequestOptions, parseAsn1Signature, requestWebAuthnSignature };