From de11459cb1d71564230c922a1b1bbffa8e5a2231 Mon Sep 17 00:00:00 2001 From: Didactic Drunk <1479616+didactic-drunk@users.noreply.github.com> Date: Sun, 13 Jun 2021 12:42:14 -0700 Subject: [PATCH] Crypto::Secret Add protection method stubs --- .../{crypto-secret.cr => secret.cr} | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) rename src/crypto-secret/{crypto-secret.cr => secret.cr} (51%) diff --git a/src/crypto-secret/crypto-secret.cr b/src/crypto-secret/secret.cr similarity index 51% rename from src/crypto-secret/crypto-secret.cr rename to src/crypto-secret/secret.cr index 970a2d5..b1335f6 100644 --- a/src/crypto-secret/crypto-secret.cr +++ b/src/crypto-secret/secret.cr @@ -1,6 +1,8 @@ # Interface to hold sensitive information (often cryptographic keys) # +# **Only for direct use by cryptographic library authors** # +# For all other applications use a preexisting class that include `Crypto::Secret` @[Experimental] module Crypto::Secret abstract def to_slice : Bytes @@ -8,14 +10,26 @@ module Crypto::Secret def readwrite end + def readwrite + yield + end + def readonly end + def readonly + yield + end + def noaccess end + def noaccess + yield + end + def wipe - # Todo: implement wiping + # Todo: implement wiping. Needs crystal support end def wipe