iya-sts
    Preparing search index...
    write: (
        username: any,
        record: any,
        opts: any,
    ) =>
        | {
            errorCode: string;
            errors: string[];
            key?: undefined;
            ok: boolean;
            written?: undefined;
        }
        | {
            errorCode: string;
            errors: string[];
            key?: undefined;
            ok: boolean;
            written: any[];
        }
        | {
            errorCode?: undefined;
            errors: any[];
            key: {
                caId: string;
                certificatePem: string;
                chainPem: any;
                createdAt: string;
                expiresAt: string;
                id: string;
                jwsAlg: string;
                keyAlg: string;
                kid: string;
                label: string;
                notAfter: string;
                notBefore: string;
                serialHex: string;
                source: string;
                subject: string;
                thumbprint: string;
            } & { privateKeyHeld: boolean; state: string };
            ok: boolean;
            written: any[];
        } = write

    Type Declaration

      • (
            username: any,
            record: any,
            opts: any,
        ):
            | {
                errorCode: string;
                errors: string[];
                key?: undefined;
                ok: boolean;
                written?: undefined;
            }
            | {
                errorCode: string;
                errors: string[];
                key?: undefined;
                ok: boolean;
                written: any[];
            }
            | {
                errorCode?: undefined;
                errors: any[];
                key: {
                    caId: string;
                    certificatePem: string;
                    chainPem: any;
                    createdAt: string;
                    expiresAt: string;
                    id: string;
                    jwsAlg: string;
                    keyAlg: string;
                    kid: string;
                    label: string;
                    notAfter: string;
                    notBefore: string;
                    serialHex: string;
                    source: string;
                    subject: string;
                    thumbprint: string;
                } & { privateKeyHeld: boolean; state: string };
                ok: boolean;
                written: any[];
            }
      • Adds an issued or uploaded key pair to a person's entry, every value or a failure naming which one.

        The private key is sealed and written first; a key pair that fails to seal or write is lost, since this service keeps no copy. Refused at the cap (pki.personSigningKeyMax, STS-PKI-0223) and for a label that is not a short name (STS-PKI-0225). A CAEP credential-change event follows a successful write.

        Parameters

        • username: any

          the person's username

        • record: any

          the key pair from pki.js: private key, certificate, chain, JWK, kid, thumbprint, serial, notAfter, source

        • opts: any

          purpose (jwt by default), issuer to declare, label, and initiatingEntity and via for the event

        Returns
            | {
                errorCode: string;
                errors: string[];
                key?: undefined;
                ok: boolean;
                written?: undefined;
            }
            | {
                errorCode: string;
                errors: string[];
                key?: undefined;
                ok: boolean;
                written: any[];
            }
            | {
                errorCode?: undefined;
                errors: any[];
                key: {
                    caId: string;
                    certificatePem: string;
                    chainPem: any;
                    createdAt: string;
                    expiresAt: string;
                    id: string;
                    jwsAlg: string;
                    keyAlg: string;
                    kid: string;
                    label: string;
                    notAfter: string;
                    notBefore: string;
                    serialHex: string;
                    source: string;
                    subject: string;
                    thumbprint: string;
                } & { privateKeyHeld: boolean; state: string };
                ok: boolean;
                written: any[];
            }

        { ok, written, key, errors }, with errorCode on a refusal