otupy.types.base.binary.Binary

class Binary(b=None)

Bases: Openc2Type

OpenC2 Binary data

Binary data that are expected to be encoded with base64 as defined in [RFC4648], Section 5 (Sec. 3.1.5).

Methods

fromdict

Builds from base64encoding

get

set

Set the value internally and covert it, if necessary.

todict

Encodes with base64

__init__(b=None)

Initializes from bytes, Binary, base64 strings, or null

classmethod fromdict(dic, e=None)

Builds from base64encoding

Parameters:
  • dic – The intermediary dictionary representation from which the object is built.

  • e – The Encoder that is being used.

Returns:

An instance of this class initialized from the dictionary values.

set(b)

Set the value internally and covert it, if necessary.

todict(e=None)

Encodes with base64

Parameters:

e – The Encoder that is being used.

Returns:

A dictionary compliants to the Language Specification’s serialization rules.