Get the address from a private key bundle
499441
def get_privkey_address(privkey_info, blockchain='bitcoin', **blockchain_opts):
    
    if blockchain == 'bitcoin':
        return btc_get_privkey_address(privkey_info, **blockchain_opts)
    else:
        raise ValueError('Unknown blockchain "{}"'.format(blockchain))
707839
public static String getToken(Bundle bundle) {
        Validate.notNull(bundle, "bundle");
        return bundle.getString(TOKEN_KEY);
    }
1228847
def btc_get_privkey_address(privkey_info, **blockchain_opts):
    
    
    from .multisig import make_multisig_segwit_address_from_witness_script

    if btc_is_singlesig(privkey_info):
        return btc_address_reencode( ecdsalib.ecdsa_private_key(privkey_info).public_key().address() )
    
    if btc_is_multisig(privkey_info) or btc_is_singlesig_segwit(privkey_info):
        redeem_script = str(privkey_info['redeem_script'])
        return btc_make_p2sh_address(redeem_script)
    
    if btc_is_multisig_segwit(privkey_info):
        return make_multisig_segwit_address_from_witness_script(str(privkey_info['redeem_script']))

    raise ValueError("Invalid private key info")
835308
function getAddress (publicKey) {
	var publicKeyHash = crypto.createHash('sha256').update(publicKey.toString('hex'), 'hex').digest();
	var temp = Buffer.alloc(8);

	for (var i = 0; i < 8; i++) {
		temp[i] = publicKeyHash[7 - i];
	}

	var address = bignum.fromBuffer(temp).toString() + 'R';
	return address;
}
8727
function getAction(key) {
    const keyString = key.toString();

    if (keyString.match(/CERTIFICATE\sREQUEST-{5}$/m)) {
        return 'req';
    }
    else if (keyString.match(/(PUBLIC|PRIVATE)\sKEY-{5}$/m)) {
        return 'rsa';
    }

    return 'x509';
}
400981
def _get_key_info(self):
        """"""
        if self._key_info_cache is None:
            self._key_info_cache = ssh_key_info_from_key_data(self.key_id,
                                                              self.priv_key)
        return self._key_info_cache
426785
function getAddressFromPriKeyBase64String(priKeyBase64String) {
  let priKeyBytes = base64DecodeFromString(priKeyBase64String);
  let pubBytes = getPubKeyFromPriKey(priKeyBytes);
  let addressBytes = computeAddress(pubBytes);
  let addressBase64 = base64EncodeToString(addressBytes);
  return addressBase64;
}
499986
def GetAddress(self):
        
        script = b'21' + self.PublicKey.encode_point(True) + b'ac'
        script_hash = Crypto.ToScriptHash(script)
        address = Crypto.ToAddress(script_hash)
        return address
1259873
def get_keypair_fn():
  """"""

  keypair_name = get_keypair_name()
  account = get_account_number()
  region = get_region()
  fn = f'{PRIVATE_KEY_LOCATION}/{keypair_name}-{account}-{region}.pem'
  return fn
624581
def decode_privkey_hex(privkey_hex):
    
    if not isinstance(privkey_hex, (str, unicode)):
        raise ValueError("private key is not a string")

    # force uncompressed
    priv = str(privkey_hex)
    if len(priv) > 64:
        if priv[-2:] != '01':
            raise ValueError("private key does not end in '01'")

        priv = priv[:64]

    pk_i = int(priv, 16)
    return pk_i
23282
def getPublicBundle(self):
        

        self.__checkSPKTimestamp()

        ik_pub    = self.__ik.pub
        spk_pub   = self.__spk["key"].pub
        spk_sig   = self.__spk["signature"]
        otpk_pubs = [ otpk.pub for otpk in self.__otpks ]

        return PublicBundle(ik_pub, spk_pub, spk_sig, otpk_pubs)
1221725
def get_private_ip(self, addr_family=None, *args, **kwargs):
        """"""
        return self.get_ip('private', addr_family, *args, **kwargs)
1212709
def get_address(name, hash, db, target=None):
        '''
        
        '''

        key = DB.pkey([EZO.DEPLOYED, name, target, hash])

        d, err = db.get(key)
        if err:
            return None, err
        if not d:
            return None, None
        return d['address'].lower(), None
441725
def address_from_public_key(pk_bytes):
    
    final_bytes = bytearray()

    # version
    final_bytes.append(6 << 3)
    # public key
    final_bytes.extend(pk_bytes)
    # checksum
    final_bytes.extend(struct.pack("<H", _crc16_checksum(final_bytes)))

    return base64.b32encode(final_bytes).decode()
398695
def get_publickey(keydata):
    """"""
    try:
        key = serialization.load_pem_public_key(
            keydata,
            backend=default_backend(),
        )
        return key
    except ValueError:
        key = serialization.load_pem_private_key(
            keydata,
            password=None,
            backend=default_backend(),
        )
        key = key.public_key()
        return key
1156263
def get_public_key(self):
        """"""
        return PublicKey.from_verifying_key(
            self._private_key.get_verifying_key(),
            network=self.network, compressed=self.compressed)
798168
def _load_private_key(self, private_key, passphrase=None):
        
        key = None
        last_exception = None
        for pkey_class in (RSAKey, DSSKey):
            try:
                key = pkey_class.from_private_key(StringIO(private_key),
                    passphrase)
            except PasswordRequiredException as e:
                # The key file is encrypted and no passphrase was provided.
                # There's no point to continue trying
                raise
            except SSHException as e:
                last_exception = e
                continue
            else:
                break
        if key is None and last_exception:
            raise last_exception
        return key