本文整理汇总了Golang中ibm-security-innovation/libsecurity-go/storage.SecureStorage.GetDecryptStorageData方法的典型用法代码示例。如果您正苦于以下问题:Golang SecureStorage.GetDecryptStorageData方法的具体用法?Golang SecureStorage.GetDecryptStorageData怎么用?Golang SecureStorage.GetDecryptStorageData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ibm-security-innovation/libsecurity-go/storage.SecureStorage
的用法示例。
在下文中一共展示了SecureStorage.GetDecryptStorageData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: playWithSecureStorage
func playWithSecureStorage(storage *ss.SecureStorage, secret []byte) {
fileName := "try.txt"
defer os.Remove(fileName)
err := storage.StoreInfo(fileName)
if err != nil {
fmt.Println("Error while saving:", err)
}
fmt.Println("Original data:")
fmt.Println(storage.GetDecryptStorageData())
keyText := fmt.Sprintf(keyFmt, 1)
err = storage.RemoveItem(keyText)
if err != nil {
fmt.Println("Error while remove key:", err)
}
fmt.Println("After removing:")
fmt.Println(storage.GetDecryptStorageData())
sd, err := ss.LoadInfo(fileName, secret)
if err != nil {
fmt.Println("Error while reading:", err)
}
fmt.Println("The data that was read from file:", fileName)
fmt.Println(sd.GetDecryptStorageData())
}