// Unpair deletes a pairing between wallet and geth.
543668
func (s *PrivateAccountAPI) Unpair(ctx context.Context, url string, pin string) error {
	wallet, err := s.am.Wallet(url)
	if err != nil {
		return err
	}

	switch wallet := wallet.(type) {
	case *scwallet.Wallet:
		return wallet.Unpair([]byte(pin))
	default:
		return fmt.Errorf("Specified wallet does not support pairing")
	}
}
300240
func uncacheCertificate(name string) {
	certCacheMu.Lock()
	delete(certCache, name)
	certCacheMu.Unlock()
}
701830
func fetchKeyPairs(k *registry.Keypairs, orgID *identity.ID) (
	*identity.ID, *identity.ID, *crypto.KeyPairs, error) {

	enc, err := k.Select(orgID, primitive.EncryptionKeyType)
	if err != nil {
		return nil, nil, nil, err
	}

	sig, err := k.Select(orgID, primitive.SigningKeyType)
	if err != nil {
		return nil, nil, nil, err
	}

	kp := bundleKeypairs(sig, enc)
	return sig.PublicKey.ID, enc.PublicKey.ID, kp, nil
}
293675
func (c *Client) GenerateKeyPair(pass string) ([]byte, []byte, error) {
	out, err := c.PostJSON(c.Endpoint("keypair"), generateKeyPairReq{Password: pass})
	if err != nil {
		return nil, nil, trace.Wrap(err)
	}
	var kp *generateKeyPairResponse
	if err := json.Unmarshal(out.Bytes(), &kp); err != nil {
		return nil, nil, err
	}
	return kp.PrivKey, []byte(kp.PubKey), err
}
632515
func (d *requestDistributor) unregisterPeer(p *peer) {
	d.peerLock.Lock()
	delete(d.peers, p)
	d.peerLock.Unlock()
}
346026
func (cs *clientStore) unregister(ID string) (*client, error) {
	cs.Lock()
	defer cs.Unlock()
	c := cs.clients[ID]
	if c == nil {
		return nil, nil
	}
	c.Lock()
	if c.hbt != nil {
		c.hbt.Stop()
		c.hbt = nil
	}
	connID := c.info.ConnID
	c.Unlock()
	delete(cs.clients, ID)
	if len(connID) > 0 {
		delete(cs.connIDs, string(connID))
	}
	if cs.waitOnRegister != nil {
		delete(cs.waitOnRegister, ID)
	}
	err := cs.store.DeleteClient(ID)
	return c, err
}
111449
func (idx *AddrIndex) RemoveUnconfirmedTx(hash *chainhash.Hash) {
	idx.unconfirmedLock.Lock()
	defer idx.unconfirmedLock.Unlock()

	// Remove all address references to the transaction from the address
	// index and remove the entry for the address altogether if it no longer
	// references any transactions.
	for addrKey := range idx.addrsByTx[*hash] {
		delete(idx.txnsByAddr[addrKey], *hash)
		if len(idx.txnsByAddr[addrKey]) == 0 {
			delete(idx.txnsByAddr, addrKey)
		}
	}

	// Remove the entry from the transaction to address lookup map as well.
	delete(idx.addrsByTx, *hash)
}
1094420
func (s *RestoreServerInput) SetKeyPair(v string) *RestoreServerInput {
	s.KeyPair = &v
	return s
}
1043699
func (f *freeClientPool) unregisterPeer(p *peer) {
	if addr, ok := p.RemoteAddr().(*net.TCPAddr); ok {
		f.disconnect(addr.IP.String())
	}
}
787083
func (i *IdentityMapping) RootPair() Identity {
	uid, gid, _ := GetRootUIDGID(i.uids, i.gids)
	return Identity{UID: uid, GID: gid}
}
408332
func (h *Haptic) Unpause() error {
	return errorFromInt(int(
		C.SDL_HapticUnpause(h.cptr())))
}
971748
func (c *ClientsetCAStore) StoreKeypair(name string, cert *pki.Certificate, privateKey *pki.PrivateKey) error {
	return c.storeKeypair(name, cert.Certificate.SerialNumber.String(), cert, privateKey)
}
264306
func (e *Engine) Unbox(ctx context.Context, ct, nonce []byte,
	privKP *EncryptionKeyPair, pubKey []byte) (*secure.Secret, error) {

	privKey, err := e.Unseal(ctx, privKP.Private, privKP.PNonce)
	if err != nil {
		return nil, err
	}
	defer privKey.Destroy()

	nonceb := [24]byte{}
	copy(nonceb[:], nonce)

	// Get a pointer to the underlying private key in memory
	privkb := (*[32]byte)(unsafe.Pointer(&privKey.Buffer()[0]))

	pubkb := [32]byte{}
	copy(pubkb[:], pubKey)

	err = ctxutil.ErrIfDone(ctx)
	if err != nil {
		return nil, err
	}

	pt, success := box.Open([]byte{}, ct, &nonceb, &pubkb, privkb)
	if !success {
		return nil, errors.New("Failed to decrypt ciphertext")
	}

	return e.guard.Secret(pt)
}
542440
func KeyPairs(keys ...string) [][]byte {
	var hashKey, blockKey string
	if len(keys) > 0 {
		hashKey = keys[0]
	}
	if len(keys) > 1 {
		blockKey = keys[1]
	}
	keyPairs := [][]byte{}
	if len(hashKey) > 0 {
		keyPairs = append(keyPairs, []byte(hashKey))

		if len(blockKey) > 0 && blockKey != hashKey {
			keyPairs = append(keyPairs, []byte(blockKey))
		}
	}
	return keyPairs
}
762250
func (s *Server) SetKeyPair(v string) *Server {
	s.KeyPair = &v
	return s
}
281969
func unescape(b []byte, attribute bool) []byte {
	for i, c := range b {
		if c == '&' {
			dst, src := unescapeEntity(b, i, i, attribute)
			for src < len(b) {
				c := b[src]
				if c == '&' {
					dst, src = unescapeEntity(b, dst, src, attribute)
				} else {
					b[dst] = c
					dst, src = dst+1, src+1
				}
			}
			return b[0:dst]
		}
	}
	return b
}
1220849
func Unescape(token string) string {
	step1 := strings.Replace(token, encRefTok1, decRefTok1, -1)
	step2 := strings.Replace(step1, encRefTok0, decRefTok0, -1)
	return step2
}