func (h *Handler) ExportPrivateKey(tkn, account string) ([]byte, error) {
	logger := h.logger.Add("method", "ExportPrivateKey",
		"account", account)
	if !h.token.Check(tkn) {
		logger.Warn("access denied")
		return nil, ErrAccessDenied
	}

	var acc data.Account
	err := h.db.FindByPrimaryKeyTo(&acc, account)
	if err != nil {
		logger.Error(err.Error())
		if err == reform.ErrNoRows {
			return nil, ErrAccountNotFound
		}
		return nil, ErrInternal
	}
	key, err := data.ToBytes(acc.PrivateKey)
	if err != nil {
		logger.Error(err.Error())
		return nil, ErrInternal
	}

	return key, nil
}
func (h *Handler) ExportPrivateKey(tkn, account string) ([]byte, error) {
	logger := h.logger.Add("method", "ExportPrivateKey",
		"account", account)
	if !h.token.Check(tkn) {
		logger.Warn("access denied")
		return nil, ErrAccessDenied
	}

	var acc data.Account
	err := h.db.FindByPrimaryKeyTo(&acc, account)
	if err != nil {
		logger.Error(err.Error())
		if err == reform.ErrNoRows {
			return nil, ErrAccountNotFound
		}
		return nil, ErrInternal
	}
	key, err := data.ToBytes(acc.PrivateKey)
	if err != nil {
		logger.Error(err.Error())
		return nil, ErrInternal
	}

	return key, nil
}
func ( h * Handler ) ExportPrivateKey ( tkn , account string ) ( [ ] byte , error ) { logger := h . logger . Add ( " " , " " , " " , account ) if ! h . token . Check ( tkn ) { logger . Warn ( " " ) return nil , ErrAccessDenied } var acc data . Account err := h . db . FindByPrimaryKeyTo ( & acc , account ) if err != nil { logger . Error ( err . Error ( ) ) if err == reform . ErrNoRows { return nil , ErrAccountNotFound } return nil , ErrInternal } key , err := data . ToBytes ( acc . PrivateKey ) if err != nil { logger . Error ( err . Error ( ) ) return nil , ErrInternal } return key , nil }
// ExportPrivateKey returns a private key in base64 encoding by account id.
ExportPrivateKey returns a private key in base64 encoding by account id .