func (crypter *kmsCrypter) DecryptSecret(secretRecord *dao.SecretRecord) (*string, error) {
	// decrypt the datakey
	dataKey, err := crypter.fetchDataKey(secretRecord)
	if err != nil {
		return nil, err
	}

	decodedData, err := base64Decode(secretRecord.EncryptedData)
	if err != nil {
		return nil, err
	}

	// decrypt the data
	decryptedData, err := decrypt(decodedData, dataKey)
	if err != nil {
		return nil, err
	}

	secretData := string(decryptedData)
	return &secretData, nil
}
// DecryptSecret decrypts a secret record using a KMS data key
DecryptSecret decrypts a secret record using a KMS data key
// DecryptSecret decrypts a secret record using a KMS data key
func (crypter *kmsCrypter) DecryptSecret(secretRecord *dao.SecretRecord) (*string, error) {
	dataKey, err := crypter.fetchDataKey(secretRecord)
	if err != nil {
		return nil, err
	}
	decodedData, err := base64Decode(secretRecord.EncryptedData)
	if err != nil {
		return nil, err
	}
	decryptedData, err := decrypt(decodedData, dataKey)
	if err != nil {
		return nil, err
	}
	secretData := string(decryptedData)
	return &secretData, nil
}
func ( crypter * kmsCrypter ) DecryptSecret ( secretRecord * dao . SecretRecord ) ( * string , error ) { dataKey , err := crypter . fetchDataKey ( secretRecord ) if err != nil { return nil , err } decodedData , err := base64Decode ( secretRecord . EncryptedData ) if err != nil { return nil , err } decryptedData , err := decrypt ( decodedData , dataKey ) if err != nil { return nil , err } secretData := string ( decryptedData ) return & secretData , nil }
DecryptSecret decrypts a secret record using a KMS data key
DecryptSecret decrypts a secret record using a KMS data key
// decrypt the datakey // decrypt the data