Skip to content

Commit

Permalink
[FABG-721] additional functions in pkcs11 wrapper
Browse files Browse the repository at this point in the history
Change-Id: Ib6fece421e6703a1e15b83688c31e6e1a4fdfe97
Signed-off-by: Sudesh Shetty <sudesh.shetty@securekey.com>
  • Loading branch information
sudeshrshetty committed Sep 6, 2018
1 parent 4fc4b17 commit ff64cd6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/core/cryptosuite/common/pkcs11/contextHandle.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,15 @@ func (handle *ContextHandle) FindObjectsFinal(session pkcs11.SessionHandle) erro
return handle.ctx.FindObjectsFinal(session)
}

//Encrypt encrypts single-part data.
func (handle *ContextHandle) Encrypt(session pkcs11.SessionHandle, message []byte) ([]byte, error) {

handle.lock.RLock()
defer handle.lock.RUnlock()

return handle.ctx.Encrypt(session, message)
}

//EncryptInit initializes an encryption operation.
func (handle *ContextHandle) EncryptInit(session pkcs11.SessionHandle, m []*pkcs11.Mechanism, o pkcs11.ObjectHandle) error {

Expand Down

0 comments on commit ff64cd6

Please sign in to comment.