// AsAccount implements protocol.AsAccount.
AsAccount implements protocol.AsAccount.
// AsAccount implements protocol . AsAccount .
func (a *Account) AsAccount() (protocol.Account, error) {
	cipher, err := a.getCipher()
	if err != nil {
		return nil, newError("failed to get cipher").Base(err)
	}
	return &MemoryAccount{
		Cipher:      cipher,
		Key:         passwordToCipherKey([]byte(a.Password), cipher.KeySize()),
		OneTimeAuth: a.Ota,
	}, nil
}
func ( a * Account ) AsAccount ( ) ( protocol . Account , error ) { cipher , err := a . getCipher ( ) if err != nil { return nil , newError ( " " ) . Base ( err ) } return & MemoryAccount { Cipher : cipher , Key : passwordToCipherKey ( [ ] byte ( a . Password ) , cipher . KeySize ( ) ) , OneTimeAuth : a . Ota , } , nil }
AsAccount implements protocol.AsAccount.
AsAccount implements protocol . AsAccount .