UNPKG

@synotech/utils

Version:

a collection of utilities for internal use

17 lines (16 loc) 534 B
/** * This function returns a public key string with the header and footer * @module publicKeySetString * @param {string} key - a public key string without the header and footer * @return {string} {string} a public key string with the header and footer * @example * * publicKeySetString('MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA') // returns -----BEGIN PUBLIC KEY----- ... * */ export const publicKeySetString = (key: string | any): string => { return `-----BEGIN PUBLIC KEY----- ${key} -----END PUBLIC KEY----- `; };