github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/bind/keystore_android.go (about)

     1  // Copyright 2015 Keybase, Inc. All rights reserved. Use of
     2  // this source code is governed by the included BSD license.
     3  
     4  //go:build android
     5  // +build android
     6  
     7  package keybase
     8  
     9  import "github.com/keybase/client/go/libkb"
    10  
    11  // UnsafeExternalKeyStore - We have to duplicate the interface defined in libkb.UnsafeExternalKeyStore
    12  // Otherwise we get an undefined param error when we use this as an argument
    13  // in an exported func
    14  type UnsafeExternalKeyStore interface {
    15  	RetrieveSecret(serviceName string, key string) ([]byte, error)
    16  	StoreSecret(serviceName string, key string, secret []byte) error
    17  	ClearSecret(serviceName string, key string) error
    18  	GetUsersWithStoredSecretsMsgPack(serviceName string) ([]byte, error)
    19  	SetupKeyStore(serviceName string, key string) error
    20  }
    21  
    22  func SetGlobalExternalKeyStore(s UnsafeExternalKeyStore) {
    23  	// TODO: Gross! can we fix this?
    24  	libkb.SetGlobalExternalKeyStore(libkb.UnsafeExternalKeyStore(s))
    25  }