sdk.js
function generateKeyPair(scheme) {
  let keypair;
  let keys;

  switch (scheme) {
    case 'ed25519':
    case 'secp256k1':
      keypair = schemes[scheme].genKeyPair();
      keys = {
        scheme: scheme,
        private: keypair.getPrivate('hex'),
        public: keypair.getPublic('hex')
      };
      break;
    default:
      throw new Error('invalid-scheme');
      break;
  }

  return keys;
}
function generateKeyPair(scheme) {
  let keypair;
  let keys;

  switch (scheme) {
    case 'ed25519':
    case 'secp256k1':
      keypair = schemes[scheme].genKeyPair();
      keys = {
        scheme: scheme,
        private: keypair.getPrivate('hex'),
        public: keypair.getPublic('hex')
      };
      break;
    default:
      throw new Error('invalid-scheme');
      break;
  }

  return keys;
}
function generateKeyPair ( scheme ) { let keypair ; let keys ; switch ( scheme ) { case 'ed25519' : case 'secp256k1' : keypair = schemes [ scheme ] . genKeyPair ( ) ; keys = { scheme : scheme , private : keypair . getPrivate ( 'hex' ) , public : keypair . getPublic ( 'hex' ) } ; break ; default : throw new Error ( 'invalid-scheme' ) ; break ; } return keys ; }
Generates a pair of cryptographic keys
@param {string} scheme - A cryptographic scheme
@return {Object} keys - A cryptographic key pair
Generates a pair of cryptographic keys