keys/keybase.go
func (kb dbKeybase) Update(name, oldpass, newpass string) error {
	info, err := kb.Get(name)
	if err != nil {
		return err
	}
	switch info.(type) {
	case localInfo:
		linfo := info.(localInfo)
		key, err := unarmorDecryptPrivKey(linfo.PrivKeyArmor, oldpass)
		if err != nil {
			return err
		}
		kb.writeLocalKey(key, name, newpass)
		return nil
	default:
		return fmt.Errorf("Locally stored key required")
	}
}
func (kb dbKeybase) Update(name, oldpass, newpass string) error {
	info, err := kb.Get(name)
	if err != nil {
		return err
	}
	switch info.(type) {
	case localInfo:
		linfo := info.(localInfo)
		key, err := unarmorDecryptPrivKey(linfo.PrivKeyArmor, oldpass)
		if err != nil {
			return err
		}
		kb.writeLocalKey(key, name, newpass)
		return nil
	default:
		return fmt.Errorf("Locally stored key required")
	}
}
func ( kb dbKeybase ) Update ( name , oldpass , newpass string ) error { info , err := kb . Get ( name ) if err != nil { return err } switch info . ( type ) { case localInfo : linfo := info . ( localInfo ) key , err := unarmorDecryptPrivKey ( linfo . PrivKeyArmor , oldpass ) if err != nil { return err } kb . writeLocalKey ( key , name , newpass ) return nil default : return fmt . Errorf ( " " ) } }
// Update changes the passphrase with which an already stored key is
// encrypted.
//
// oldpass must be the current passphrase used for encryption,
// newpass will be the only valid passphrase from this time forward.
Update changes the passphrase with which an already stored key is encrypted . oldpass must be the current passphrase used for encryption newpass will be the only valid passphrase from this time forward .