update k8 operator to use service account

This commit is contained in:
Maidul Islam
2023-04-16 16:51:36 -07:00
parent 56c35293eb
commit 619fe553ef
13 changed files with 388 additions and 30 deletions
+7
View File
@@ -3,6 +3,8 @@ package crypto
import (
"crypto/aes"
"crypto/cipher"
"golang.org/x/crypto/nacl/box"
)
func DecryptSymmetric(key []byte, encryptedPrivateKey []byte, tag []byte, IV []byte) ([]byte, error) {
@@ -26,3 +28,8 @@ func DecryptSymmetric(key []byte, encryptedPrivateKey []byte, tag []byte, IV []b
return plaintext, nil
}
func DecryptAsymmetric(ciphertext []byte, nonce []byte, publicKey []byte, privateKey []byte) (plainText []byte) {
plainTextToReturn, _ := box.Open(nil, ciphertext, (*[24]byte)(nonce), (*[32]byte)(publicKey), (*[32]byte)(privateKey))
return plainTextToReturn
}