You are viewing information archived from Mozilla.org on 2014-10-02.
Package nss :: Module nss :: Class PK11SymKey
[hide private]
[frames] | no frames]

Class PK11SymKey

object --+
         |
        PK11SymKey

Holds a hash, encryption or signing context for multi-part operations.
Instance Methods [hide private]
 
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__repr__(x)
repr(x)
 
__str__(x)
str(x)
PK11SymKey
derive(mechanism, sec_param, target, operation, key_size)
Derive a new key from this key.
PK11SymKey
unwrap_sym_key(mechanism, sec_param, wrapped_key, target, operation, key_size)
Unwrap (decrypt) the supplied wrapped key.
SecItem
wrap_sym_key(mechanism, sec_param, sym_key)
Wrap (encrypt) the supplied sym_key using the mechanism and parameter.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]
  key_data
key data
  key_length
key length
  mechanism
CK_MECHANISM_TYPE mechanism
  slot
slot

Inherited from object: __class__

Method Details [hide private]

__init__(...)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__

__repr__(x)
(Representation operator)

 
repr(x)
Overrides: object.__repr__

__str__(x)
(Informal representation operator)

 
str(x)
Overrides: object.__str__

derive(mechanism, sec_param, target, operation, key_size)

 
Derive a new key from this key. Return a key which can do exactly one operation, it is ephemeral (session key).
Parameters:
  • mechanism (int) - key mechanism enumeration constant (CKM_*)
  • sec_param (SecItem object or None) - mechanism parameters or None.
  • target (int) - key mechanism enumeration constant (CKM_*)
  • operation (int) - type of operation. A (CKA_*) constant (e.g. CKA_ENCRYPT, CKA_DECRYPT, CKA_SIGN, CKA_VERIFY, CKA_DIGEST)
  • key_size (int) - key size.
Returns: PK11SymKey

unwrap_sym_key(mechanism, sec_param, wrapped_key, target, operation, key_size)

 
Unwrap (decrypt) the supplied wrapped key. Return the unwrapped key as a PK11SymKey.
Parameters:
  • mechanism (int) - key mechanism enumeration constant (CKM_*)
  • sec_param (SecItem object or None) - mechanism parameters or None.
  • wrapped_key (SecItem object) - the symmetric key to unwrap
  • target (int) - key mechanism enumeration constant (CKM_*)
  • operation (int) - type of operation. A (CKA_*) constant (e.g. CKA_ENCRYPT, CKA_DECRYPT, CKA_SIGN, CKA_VERIFY, CKA_DIGEST)
  • key_size (int) - key size.
Returns: PK11SymKey

wrap_sym_key(mechanism, sec_param, sym_key)

 
Wrap (encrypt) the supplied sym_key using the mechanism and parameter. Return the wrapped key as a SecItem.
Parameters:
  • mechanism (int) - key mechanism enumeration constant (CKM_*)
  • sec_param (SecItem object or None) - mechanism parameters or None.
  • sym_key (PK11SymKey object) - the symmetric key to wrap
Returns: SecItem