Exemple #1
0
 def recipient_id(self):
     """Return recipient identifier."""
     result = self._lib_vscf_key_recipient_info.vscf_key_recipient_info_recipient_id(
         self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #2
0
 def nonce(self):
     """Return IV."""
     result = self._lib_vscf_cipher_alg_info.vscf_cipher_alg_info_nonce(
         self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #3
0
 def get_session_id(self):
     """Returns session id."""
     result = self._lib_vscr_ratchet_group_session.vscr_ratchet_group_session_get_session_id(
         self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #4
0
 def salt(self):
     """Return KDF salt."""
     result = self._lib_vscf_salted_kdf_alg_info.vscf_salted_kdf_alg_info_salt(
         self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #5
0
 def title(self, pem):
     """Returns PEM title if PEM data is valid, otherwise - empty data."""
     d_pem = Data(pem)
     result = self._lib_vscf_pem.vscf_pem_title(d_pem.data)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #6
0
 def encrypted_key(self):
     """Return an encrypted data encryption key."""
     result = self._lib_vscf_password_recipient_info.vscf_password_recipient_info_encrypted_key(
         self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #7
0
 def data(self):
     """Return key data."""
     result = self._lib_vscf_raw_public_key.vscf_raw_public_key_data(
         self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #8
0
 def signature(self):
     """Return data signature."""
     result = self._lib_vscf_signer_info.vscf_signer_info_signature(
         self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #9
0
 def signer_id(self):
     """Return signer identifier."""
     result = self._lib_vscf_signer_info.vscf_signer_info_signer_id(
         self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #10
0
 def get_one_time_public_key(self):
     """Returns one-time public key, if message is prekey message and if one-time key is present, empty result otherwise."""
     result = self._lib_vscr_ratchet_message.vscr_ratchet_message_get_one_time_public_key(
         self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #11
0
 def get_long_term_public_key(self):
     """Returns long-term public key, if message is prekey message."""
     result = self._lib_vscr_ratchet_message.vscr_ratchet_message_get_long_term_public_key(
         self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #12
0
 def get_session_id(self):
     """Returns session id.
     This method should be called only for group info type."""
     result = self._lib_vscr_ratchet_group_message.vscr_ratchet_group_message_get_session_id(
         self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #13
0
 def find_data(self, key):
     """Return custom parameter with octet string value."""
     d_key = Data(key)
     error = vscf_error_t()
     result = self._lib_vscf_message_info_custom_params.vscf_message_info_custom_params_find_data(self.ctx, d_key.data, error)
     VscfStatus.handle_status(error.status)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #14
0
 def process_data(self, data):
     """Only data length is needed to produce padding later.
     Return data that should be further proceeded."""
     d_data = Data(data)
     result = self._lib_vscf_random_padding.vscf_random_padding_process_data(
         self.ctx, d_data.data)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #15
0
 def signer_digest(self):
     """Return plain text digest that was used to produce signature."""
     result = self._lib_vscf_message_info_footer.vscf_message_info_footer_signer_digest(self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #16
0
 def from_id(self, oid_id):
     """Return OID for a given identifier."""
     result = self._lib_vscf_oid.vscf_oid_from_id(oid_id)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #17
0
 def read_data(self, len):
     """Read raw data of given length."""
     result = self._lib_vscf_asn1rd.vscf_asn1rd_read_data(self.ctx, len)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #18
0
 def read_oid(self):
     """Read ASN.1 type: OID."""
     result = self._lib_vscf_asn1rd.vscf_asn1rd_read_oid(self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #19
0
 def read_utf8_str(self):
     """Read ASN.1 type: UTF8String."""
     result = self._lib_vscf_asn1rd.vscf_asn1rd_read_utf8_str(self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes
Exemple #20
0
 def read_bitstring_as_octet_str(self):
     """Read ASN.1 type: BIT STRING."""
     result = self._lib_vscf_asn1rd.vscf_asn1rd_read_bitstring_as_octet_str(self.ctx)
     instance = Data.take_c_ctx(result)
     cleaned_bytes = bytearray(instance)
     return cleaned_bytes