INSTRUCTION stringlengths 1 8.43k | RESPONSE stringlengths 75 104k |
|---|---|
Extract an X. 509 certificate from a socket connection. | def get_certificate_from_connection(connection):
"""
Extract an X.509 certificate from a socket connection.
"""
certificate = connection.getpeercert(binary_form=True)
if certificate:
return x509.load_der_x509_certificate(
certificate,
backends.default_backend()
... |
Given an X. 509 certificate extract and return the extendedKeyUsage extension. | def get_extended_key_usage_from_certificate(certificate):
"""
Given an X.509 certificate, extract and return the extendedKeyUsage
extension.
"""
try:
return certificate.extensions.get_extension_for_oid(
x509.oid.ExtensionOID.EXTENDED_KEY_USAGE
).value
except x509.Exte... |
Given an X. 509 certificate extract and return all common names. | def get_common_names_from_certificate(certificate):
"""
Given an X.509 certificate, extract and return all common names.
"""
common_names = certificate.subject.get_attributes_for_oid(
x509.oid.NameOID.COMMON_NAME
)
return [common_name.value for common_name in common_names] |
Given an X. 509 certificate extract and return the client identity. | def get_client_identity_from_certificate(certificate):
"""
Given an X.509 certificate, extract and return the client identity.
"""
client_ids = get_common_names_from_certificate(certificate)
if len(client_ids) > 0:
if len(client_ids) > 1:
raise exceptions.PermissionDenied(
... |
Read the data encoding the Create request payload and decode it into its constituent parts. | def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the Create request payload and decode it into
its constituent parts.
Args:
input_buffer (stream): A data buffer containing encoded object
data, supporting a read... |
Write the data encoding the Create request payload to a buffer. | def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the Create request payload to a buffer.
Args:
output_buffer (stream): A data buffer in which to encode object
data, supporting a write method.
kmip_versio... |
Read the data encoding the Create response payload and decode it into its constituent parts. | def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the Create response payload and decode it into
its constituent parts.
Args:
input_buffer (stream): A data buffer containing encoded object
data, supporting a rea... |
Write the data encoding the Create response payload to a buffer. | def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the Create response payload to a buffer.
Args:
output_buffer (stream): A data buffer in which to encode object
data, supporting a write method.
kmip_versi... |
Convert a Pie object into a core secret object and vice versa. | def convert(self, obj):
"""
Convert a Pie object into a core secret object and vice versa.
Args:
obj (various): A Pie or core secret object to convert into the
opposite object space. Required.
Raises:
TypeError: if the object type is unrecognized... |
Read the data encoding the Encrypt response payload and decode it into its constituent parts. | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the Encrypt response payload and decode it
into its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a re... |
Read the data encoding the DeriveKey request payload and decode it into its constituent parts. | def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the DeriveKey request payload and decode it
into its constituent parts.
Args:
input_buffer (stream): A data stream containing encoded object
data, supporting a r... |
Write the data encoding the DeriveKey request payload to a stream. | def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the DeriveKey request payload to a stream.
Args:
output_buffer (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayS... |
Check if the attribute is supported by the current KMIP version. | def is_attribute_supported(self, attribute):
"""
Check if the attribute is supported by the current KMIP version.
Args:
attribute (string): The name of the attribute
(e.g., 'Cryptographic Algorithm'). Required.
Returns:
bool: True if the attribute... |
Check if the attribute is deprecated by the current KMIP version. | def is_attribute_deprecated(self, attribute):
"""
Check if the attribute is deprecated by the current KMIP version.
Args:
attribute (string): The name of the attribute
(e.g., 'Unique Identifier'). Required.
"""
rule_set = self._attribute_rule_sets.get... |
Check if the attribute is supported by the given object type. | def is_attribute_applicable_to_object_type(self, attribute, object_type):
"""
Check if the attribute is supported by the given object type.
Args:
attribute (string): The name of the attribute (e.g., 'Name').
Required.
object_type (ObjectType): An ObjectTy... |
Check if the attribute is allowed to have multiple instances. | def is_attribute_multivalued(self, attribute):
"""
Check if the attribute is allowed to have multiple instances.
Args:
attribute (string): The name of the attribute
(e.g., 'State'). Required.
"""
# TODO (peterhamilton) Handle multivalue swap between c... |
Returns a value that can be used as a parameter in client or server. If a direct_value is given that value will be returned instead of the value from the config file. If the appropriate config file option is not found the default_value is returned. | def get_valid_value(self, direct_value, config_section,
config_option_name, default_value):
"""Returns a value that can be used as a parameter in client or
server. If a direct_value is given, that value will be returned
instead of the value from the config file. If the ap... |
Read the data encoding the Check response payload and decode it into its constituent parts. | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Read the data encoding the Check response payload and decode it into
its constituent parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a read... |
Write the data encoding the Check response payload to a stream. | def write(self, output_stream, kmip_version=enums.KMIPVersion.KMIP_1_0):
"""
Write the data encoding the Check response payload to a stream.
Args:
output_stream (stream): A data stream in which to encode object
data, supporting a write method; usually a BytearrayStre... |
Read the data stream and decode the AttributeReference structure into its parts. | def read(self, input_buffer, kmip_version=enums.KMIPVersion.KMIP_2_0):
"""
Read the data stream and decode the AttributeReference structure into
its parts.
Args:
input_buffer (stream): A data stream containing encoded object
data, supporting a read method.
... |
Write the AttributeReference structure encoding to the data stream. | def write(self, output_buffer, kmip_version=enums.KMIPVersion.KMIP_2_0):
"""
Write the AttributeReference structure encoding to the data stream.
Args:
output_buffer (stream): A data stream in which to encode
Attributes structure data, supporting a write method.
... |
Read the data stream and decode the Attributes structure into its parts. | def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_2_0):
"""
Read the data stream and decode the Attributes structure into its
parts.
Args:
input_stream (stream): A data stream containing encoded object
data, supporting a read method.
... |
Write the Attributes structure encoding to the data stream. | 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... |
Read the data encoding the Nonce struct and decode it into its constituent parts. | 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... |
Write the data encoding the Nonce struct to a stream. | 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
... |
Read the data encoding the UsernamePasswordCredential struct and decode it into its constituent parts. | 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... |
Write the data encoding the UsernamePasswordCredential struct to a stream. | 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... |
Read the data encoding the DeviceCredential struct and decode it into its constituent parts. | 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... |
Write the data encoding the DeviceCredential struct to a stream. | 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... |
Read the data encoding the Credential struct and decode it into its constituent parts. | 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... |
Write the data encoding the Credential struct to a stream. | 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
... |
Read the data encoding the MACSignatureKeyInformation struct and decode it into its constituent parts. | 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... |
Write the data encoding the MACSignatureKeyInformation struct to a stream. | 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... |
Read the data encoding the KeyWrappingData struct and decode it into its constituent parts. | 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... |
Write the data encoding the KeyWrappingData struct to a stream. | 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... |
Read the data encoding the KeyWrappingSpecification struct and decode it into its constituent parts. | 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... |
Write the data encoding the KeyWrappingSpecification struct to a stream. | 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... |
Read the data encoding the ExtensionInformation object and decode it into its constituent parts. | 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... |
Write the data encoding the ExtensionInformation object to a stream. | 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... |
Construct an ExtensionInformation object from provided extension values. | 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.
... |
Read the data encoding the RevocationReason object and decode it into its constituent parts. | 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; ... |
Write the data encoding the RevocationReason object to a stream. | 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.
... |
validate the RevocationReason 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(... |
Read the data encoding the ObjectDefaults structure and decode it into its constituent parts. | 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... |
Write the ObjectDefaults structure encoding to the data stream. | 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.
... |
Read the data encoding the DefaultsInformation structure and decode it into its constituent parts. | 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... |
Write the DefaultsInformation structure encoding to the data stream. | 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.
... |
Read the data encoding the RNGParameters structure and decode it into its constituent parts. | 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... |
Write the RNGParameters structure encoding to the data stream. | 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.
... |
Read the data encoding the ProfileInformation structure and decode it into its constituent parts. | 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 ... |
Write the ProfileInformation structure encoding to the data stream. | 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... |
Read the data encoding the ValidationInformation structure and decode it into its constituent parts. | 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... |
Write the ValidationInformation structure encoding to the data stream. | 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... |
Read the data encoding the CapabilityInformation structure and decode it into its constituent parts. | 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... |
Write the CapabilityInformation structure encoding to the data stream. | 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... |
Prepare the server to start serving connections. | 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:
... |
Stop the server. | 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... |
Serve client connections. | 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... |
Read the data encoding the Locate request payload and decode it into its constituent parts. | 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... |
Write the data encoding the Locate request payload to a buffer. | 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... |
Read the data encoding the Locate response payload and decode it into its constituent parts. | 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... |
Write the data encoding the Locate response payload to a buffer. | 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... |
Create a symmetric key. | 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. ... |
Create an asymmetric key pair. | 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 ... |
Generate message authentication code. | 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
... |
Encrypt data using symmetric or asymmetric encryption. | 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... |
Encrypt data using symmetric encryption. | 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... |
Encrypt data using asymmetric encryption. | def _encrypt_asymmetric(self,
encryption_algorithm,
encryption_key,
plain_text,
padding_method,
hashing_algorithm=None):
"""
Encrypt data using asymmetric encryptio... |
Decrypt data using symmetric decryption. | 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.... |
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... |
Encrypt data using asymmetric decryption. | def _decrypt_asymmetric(
self,
decryption_algorithm,
decryption_key,
cipher_text,
padding_method,
hashing_algorithm=None):
"""
Encrypt data using asymmetric decryption.
Args:
decryption_algorithm (CryptographicA... |
Create an RSA key pair. | 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... |
Derive key data using a variety of key derivation functions. | def derive_key(self,
derivation_method,
derivation_length,
derivation_data=None,
key_material=None,
hash_algorithm=None,
salt=None,
iteration_count=None,
encryption_alg... |
Args: key_material ( bytes ): The bytes of the key to wrap. Required. wrapping_method ( WrappingMethod ): A WrappingMethod enumeration specifying what wrapping technique to use to wrap the key material. Required. key_wrap_algorithm ( BlockCipherMode ): A BlockCipherMode enumeration specifying the key wrapping algorithm... | 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... |
Instantiates an RSA key from bytes. | 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... |
Args: digital_signature_algorithm ( DigitalSignatureAlgorithm ): An enumeration specifying the asymmetric cryptographic algorithm and hashing algorithm to use for the signature operation. Can be None if cryptographic_algorithm and hash_algorithm are set. crypto_alg ( CryptographicAlgorithm ): An enumeration specifying ... | def sign(self,
digital_signature_algorithm,
crypto_alg,
hash_algorithm,
padding,
signing_key,
data):
"""
Args:
digital_signature_algorithm (DigitalSignatureAlgorithm): An
enumeration specifying the ... |
Verify a message signature. | def verify_signature(self,
signing_key,
message,
signature,
padding_method,
signing_algorithm=None,
hashing_algorithm=None,
digital_signature_alg... |
Read the data encoding the Sign response payload and decode it. | 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
... |
Write the data encoding the Sign response to a stream. | 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
... |
Read the data encoding the GetUsageAllocation request payload and decode it into its constituent parts. | 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... |
Convert a ProtocolVersion struct to its KMIPVersion enumeration equivalent. | 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... |
Read the data encoding the ProtocolVersion struct and decode it into its constituent parts. | 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... |
Write the data encoding the ProtocolVersion struct to a stream. | 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... |
Read the data encoding the Authentication struct and decode it into its constituent parts. | 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 ... |
Write the data encoding the Authentication struct to a stream. | 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... |
Read the data encoding the Poll request payload and decode it into its constituent parts. | 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... |
Read the data encoding the Certificate object and decode it into its constituent parts. | 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... |
Write the data encoding the Certificate object to a stream. | 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.
... |
Query the configured SLUGS service with the provided credentials. | 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... |
Read the data encoding the Archive response payload and decode it into its constituent parts. | 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... |
Write the data encoding the Archive response payload to a stream. | 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... |
The main thread routine executed by invoking thread. start. | 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... |
Write the data encoding the Rekey request payload to a stream. | 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... |
Read the data encoding the Rekey response payload and decode it into its constituent parts. | 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... |
Write the data encoding the Rekey request payload to a stream. | 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... |
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 object. kmip_version ( KMIPVersion ): An enumeration defining the KMIP version with which the object will be encoded. Option... | 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... |
Error check the attributes of the ActivateRequestPayload object. | 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... |
Set the KMIP version for the client. | 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.... |
Check if a profile is supported by the 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 ... |
Check object usage according to specific constraints. | 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
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.