Hi,

I can create a SECKEYPublicKey from raw material by directly access it's public struct. Can I create a PK11SymKey from raw materail by directly access the PK11SymKeyStr and only set the data and type fields available? That is:

PK11SymKey* symKey ;
......
symKey->type = aType ;
symKey->objectID = CK_INVALID_HANDLE ;
symKey->slot = NULL ;
symKey->cx = NULL ;
symKey->next = NULL ;
symKey->data = duplicate the raw key material;
symKey->session = INVALID;
symKey->sessionOwner = PR_False ;
symKey->refCount = 1 ;
symKey->size = size of raw key material ;
symKey->origin = PK11_OriginUnwrap ;
symKey->serials = ?

Does it will work for encryption and decryption useing PK11_CipherOp? Do I have another ways?

Thanks,
Andrew



Reply via email to