Search is not available for this dataset
text
stringlengths
75
104k
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_2_0): """ Write the Attributes structure encoding to the data stream. Args: output_stream (stream): A data stream in which to encode Attributes structure data, supporting a write method. k...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the Nonce struct and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, supporting a read method; u...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the Nonce struct to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStream ...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the UsernamePasswordCredential struct and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, suppor...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the UsernamePasswordCredential struct to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usua...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the DeviceCredential struct and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, supporting a rea...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the DeviceCredential struct to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStr...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the Credential struct and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, supporting a read meth...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the Credential struct to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStream ...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the MACSignatureKeyInformation struct and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, suppor...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the MACSignatureKeyInformation struct to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usua...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the KeyWrappingData struct and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, supporting a read...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the KeyWrappingData struct to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStre...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the KeyWrappingSpecification struct and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, supporti...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the KeyWrappingSpecification struct to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usuall...
def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the ExtensionInformation object and decode it into its constituent parts. Args: istream (Stream): A data stream containing encoded object data, supporting a read meth...
def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the ExtensionInformation object to a stream. Args: ostream (Stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStream obje...
def create(cls, extension_name=None, extension_tag=None, extension_type=None): """ Construct an ExtensionInformation object from provided extension values. Args: extension_name (str): The name of the extension. Optional, defaults to None. ...
def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the RevocationReason object and decode it into its constituent parts. Args: istream (Stream): A data stream containing encoded object data, supporting a read method; ...
def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the RevocationReason object to a stream. Args: ostream (Stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStream object. ...
def validate(self): """ validate the RevocationReason object """ if not isinstance(self.revocation_code, RevocationReasonCode): msg = "RevocationReaonCode expected" raise TypeError(msg) if self.revocation_message is not None: if not isinstance(...
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_2_0): """ Read the data encoding the ObjectDefaults structure and decode it into its constituent parts. Args: input_buffer (stream): A data stream containing encoded object data, supporting a re...
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_2_0): """ Write the ObjectDefaults structure encoding to the data stream. Args: output_buffer (stream): A data stream in which to encode Attributes structure data, supporting a write method. ...
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_2_0): """ Read the data encoding the DefaultsInformation structure and decode it into its constituent parts. Args: input_buffer (stream): A data stream containing encoded object data, supporting...
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_2_0): """ Write the DefaultsInformation structure encoding to the data stream. Args: output_buffer (stream): A data stream in which to encode Attributes structure data, supporting a write method. ...
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_3): """ Read the data encoding the RNGParameters structure and decode it into its constituent parts. Args: input_buffer (stream): A data stream containing encoded object data, supporting a rea...
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_3): """ Write the RNGParameters structure encoding to the data stream. Args: output_buffer (stream): A data stream in which to encode Attributes structure data, supporting a write method. ...
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_3): """ Read the data encoding the ProfileInformation structure and decode it into its constituent parts. Args: input_buffer (stream): A data stream containing encoded object data, supporting ...
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_3): """ Write the ProfileInformation structure encoding to the data stream. Args: output_buffer (stream): A data stream in which to encode ProfileInformation structure data, supporting a write metho...
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_3): """ Read the data encoding the ValidationInformation structure and decode it into its constituent parts. Args: input_buffer (stream): A data stream containing encoded object data, supporti...
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_3): """ Write the ValidationInformation structure encoding to the data stream. Args: output_buffer (stream): A data stream in which to encode ValidationInformation structure data, supporting a write...
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_3): """ Read the data encoding the CapabilityInformation structure and decode it into its constituent parts. Args: input_buffer (stream): A data stream containing encoded object data, supporti...
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_3): """ Write the CapabilityInformation structure encoding to the data stream. Args: output_buffer (stream): A data stream in which to encode CapabilityInformation structure data, supporting a write...
def start(self): """ Prepare the server to start serving connections. Configure the server socket handler and establish a TLS wrapping socket from which all client connections descend. Bind this TLS socket to the specified network address for the server. Raises: ...
def stop(self): """ Stop the server. Halt server client connections and clean up any existing connection threads. Raises: NetworkingError: Raised if a failure occurs while sutting down or closing the TLS server socket. """ self._logge...
def serve(self): """ Serve client connections. Begin listening for client connections, spinning off new KmipSessions as connections are handled. Set up signal handling to shutdown connection service as needed. """ self._socket.listen(5) def _signal_handl...
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the Locate request payload and decode it into its constituent parts. Args: input_buffer (stream): A data buffer containing encoded object data, supporting a read...
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the Locate request payload to a buffer. Args: output_buffer (stream): A data buffer in which to encode object data, supporting a write method. kmip_versio...
def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the Locate response payload and decode it into its constituent parts. Args: input_buffer (stream): A data buffer containing encoded object data, supporting a rea...
def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the Locate response payload to a buffer. Args: output_buffer (stream): A data buffer in which to encode object data, supporting a write method. kmip_versi...
def create_symmetric_key(self, algorithm, length): """ Create a symmetric key. Args: algorithm(CryptographicAlgorithm): An enumeration specifying the algorithm for which the created key will be compliant. length(int): The length of the key to be created. ...
def create_asymmetric_key_pair(self, algorithm, length): """ Create an asymmetric key pair. Args: algorithm(CryptographicAlgorithm): An enumeration specifying the algorithm for which the created keys will be compliant. length(int): The length of the keys ...
def mac(self, algorithm, key, data): """ Generate message authentication code. Args: algorithm(CryptographicAlgorithm): An enumeration specifying the algorithm for which the MAC operation will use. key(bytes): secret key used in the MAC operation ...
def encrypt(self, encryption_algorithm, encryption_key, plain_text, cipher_mode=None, padding_method=None, iv_nonce=None, hashing_algorithm=None): """ Encrypt data using symmetric or asymmetri...
def _encrypt_symmetric( self, encryption_algorithm, encryption_key, plain_text, cipher_mode=None, padding_method=None, iv_nonce=None): """ Encrypt data using symmetric encryption. Args: encryption_al...
def _encrypt_asymmetric(self, encryption_algorithm, encryption_key, plain_text, padding_method, hashing_algorithm=None): """ Encrypt data using asymmetric encryptio...
def decrypt(self, decryption_algorithm, decryption_key, cipher_text, cipher_mode=None, padding_method=None, iv_nonce=None, hashing_algorithm=None): """ Decrypt data using symmetric decryption....
def _decrypt_symmetric( self, decryption_algorithm, decryption_key, cipher_text, cipher_mode=None, padding_method=None, iv_nonce=None): """ Decrypt data using symmetric decryption. Args: decryption_a...
def _decrypt_asymmetric( self, decryption_algorithm, decryption_key, cipher_text, padding_method, hashing_algorithm=None): """ Encrypt data using asymmetric decryption. Args: decryption_algorithm (CryptographicA...
def _create_rsa_key_pair(self, length, public_exponent=65537): """ Create an RSA key pair. Args: length(int): The length of the keys to be created. This value must be compliant with the constraints of the provided algorithm. public_exponent(int): The valu...
def derive_key(self, derivation_method, derivation_length, derivation_data=None, key_material=None, hash_algorithm=None, salt=None, iteration_count=None, encryption_alg...
def wrap_key(self, key_material, wrapping_method, key_wrap_algorithm, encryption_key): """ Args: key_material (bytes): The bytes of the key to wrap. Required. wrapping_method (WrappingMethod): A WrappingMethod en...
def _create_RSA_private_key(self, bytes): """ Instantiates an RSA key from bytes. Args: bytes (byte string): Bytes of RSA private key. Returns: private_key (cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKe...
def sign(self, digital_signature_algorithm, crypto_alg, hash_algorithm, padding, signing_key, data): """ Args: digital_signature_algorithm (DigitalSignatureAlgorithm): An enumeration specifying the ...
def verify_signature(self, signing_key, message, signature, padding_method, signing_algorithm=None, hashing_algorithm=None, digital_signature_alg...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the Sign response payload and decode it. Args: input_stream (stream): A data stream containing encoded object data, supporting a read method; usually a BytearrayStream ...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the Sign response to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStream ...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the GetUsageAllocation request payload and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, suppo...
def protocol_version_to_kmip_version(value): """ Convert a ProtocolVersion struct to its KMIPVersion enumeration equivalent. Args: value (ProtocolVersion): A ProtocolVersion struct to be converted into a KMIPVersion enumeration. Returns: KMIPVersion: The enumeration equival...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the ProtocolVersion struct and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, supporting a read...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the ProtocolVersion struct to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStre...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the Authentication struct and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, supporting a read ...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the Authentication struct to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStrea...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the Poll request payload and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, supporting a read m...
def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the Certificate object and decode it into its constituent parts. Args: istream (Stream): A data stream containing encoded object data, supporting a read method; usual...
def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the Certificate object to a stream. Args: ostream (Stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStream object. ...
def authenticate(self, connection_certificate=None, connection_info=None, request_credentials=None): """ Query the configured SLUGS service with the provided credentials. Args: connection_certificate (cryptography.x509.C...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the Archive response payload and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, supporting a re...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the Archive response payload to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usually a BytearraySt...
def run(self): """ The main thread routine executed by invoking thread.start. This method manages the new client connection, running a message handling loop. Once this method completes, the thread is finished. """ self._logger.info("Starting session: {0}".format(self.nam...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the Rekey request payload to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStrea...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the Rekey response payload and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, supporting a read...
def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the Rekey request payload to a stream. Args: output_stream (stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStrea...
def write(self, ostream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Write the data encoding the ActivateRequestPayload object to a stream. Args: ostream (Stream): A data stream in which to encode object data, supporting a write method; usually a BytearrayStream obj...
def validate(self): """ Error check the attributes of the ActivateRequestPayload object. """ if self.unique_identifier is not None: if not isinstance(self.unique_identifier, attributes.UniqueIdentifier): msg = "invalid unique iden...
def kmip_version(self, value): """ Set the KMIP version for the client. Args: value (KMIPVersion): A KMIPVersion enumeration Return: None Raises: ValueError: if value is not a KMIPVersion enumeration Example: >>> client....
def is_profile_supported(self, conformance_clause, authentication_suite): """ Check if a profile is supported by the client. Args: conformance_clause (ConformanceClause): authentication_suite (AuthenticationSuite): Returns: bool: True if the profile ...
def rekey(self, uuid=None, offset=None, template_attribute=None, credential=None): """ Check object usage according to specific constraints. Args: uuid (string): The unique identifier of a managed cryptographic ...
def derive_key(self, object_type, unique_identifiers, derivation_method, derivation_parameters, template_attribute, credential=None): """ Derive a new key or secret data from an existing man...
def check(self, uuid=None, usage_limits_count=None, cryptographic_usage_mask=None, lease_time=None, credential=None): """ Check object usage according to specific constraints. Args: uuid (string): The unique ident...
def get_attributes(self, uuid=None, attribute_names=None): """ Send a GetAttributes request to the server. Args: uuid (string): The ID of the managed object with which the retrieved attributes should be associated. Optional, defaults to None. ...
def get_attribute_list(self, uid=None): """ Send a GetAttributeList request to the server. Args: uid (string): The ID of the managed object with which the retrieved attribute names should be associated. Returns: result (GetAttributeListResult): A...
def query(self, batch=False, query_functions=None, credential=None): """ Send a Query request to the server. Args: batch (boolean): A flag indicating if the operation should be sent with a batch of additional operations. Defaults to False. query_functions...
def encrypt(self, data, unique_identifier=None, cryptographic_parameters=None, iv_counter_nonce=None, credential=None): """ Encrypt data using the specified encryption key and parameters. Args: data (byt...
def signature_verify(self, message, signature, unique_identifier=None, cryptographic_parameters=None, credential=None): """ Verify a message signature using the specified signing ...
def sign(self, data, unique_identifier=None, cryptographic_parameters=None, credential=None): """ Sign specified data using a specified signing key. Args: data (bytes): Data to be signed. Required. unique_identifier (string): The unique ID of the signing ...
def _build_host_list(self, host_list_str): ''' This internal function takes the host string from the config file and turns it into a list :return: LIST host list ''' host_list = [] if isinstance(host_list_str, str): host_list = host_list_str.replace('...
def kmip_version(self, value): """ Set the KMIP version for the client. Args: value (KMIPVersion): A KMIPVersion enumeration Return: None Raises: ValueError: if value is not a KMIPVersion enumeration Example: >>> client....
def open(self): """ Open the client connection. Raises: ClientConnectionFailure: if the client connection is already open Exception: if an error occurs while trying to open the connection """ if self._is_open: raise exceptions.ClientConnection...
def close(self): """ Close the client connection. Raises: Exception: if an error occurs while trying to close the connection """ if not self._is_open: return else: try: self.proxy.close() self._is_open =...
def create(self, algorithm, length, operation_policy_name=None, name=None, cryptographic_usage_mask=None): """ Create a symmetric key on a KMIP appliance. Args: algorithm (CryptographicAlgorithm): An enumeration defining the algorithm to use to generat...
def create_key_pair(self, algorithm, length, operation_policy_name=None, public_name=None, public_usage_mask=None, private_name=None, private_usage_mask...
def register(self, managed_object): """ Register a managed object with a KMIP appliance. Args: managed_object (ManagedObject): A managed object to register. An instantiatable subclass of ManagedObject from the Pie API. Returns: string: The uid of...
def rekey(self, uid=None, offset=None, **kwargs): """ Rekey an existing key. Args: uid (string): The unique ID of the symmetric key to rekey. Optional, defaults to None. offset (int): The time delta, in seconds, b...
def derive_key(self, object_type, unique_identifiers, derivation_method, derivation_parameters, **kwargs): """ Derive a new key or secret data from existing managed objects. Args: object_t...
def locate(self, maximum_items=None, storage_status_mask=None, object_group_member=None, attributes=None): """ Search for managed objects, depending on the attributes specified in the request. Args: maximum_items (integer): Maximum number of object identifiers...
def check(self, uid=None, usage_limits_count=None, cryptographic_usage_mask=None, lease_time=None): """ Check the constraints for a managed object. Args: uid (string): The unique ID of the managed object to check. ...
def get(self, uid=None, key_wrapping_specification=None): """ Get a managed object from a KMIP appliance. Args: uid (string): The unique ID of the managed object to retrieve. key_wrapping_specification (dict): A dictionary containing various settings to b...
def get_attributes(self, uid=None, attribute_names=None): """ Get the attributes associated with a managed object. If the uid is not specified, the appliance will use the ID placeholder by default. If the attribute_names list is not specified, the appliance will return ...
def activate(self, uid=None): """ Activate a managed object stored by a KMIP appliance. Args: uid (string): The unique ID of the managed object to activate. Optional, defaults to None. Returns: None Raises: ClientConnectionNo...