Documentation
¶
Overview ¶
Package identity implements the STIX 2.1 Identity object.
The following information comes directly from the STIX 2.1 specification.
Identities can represent actual individuals, organizations, or groups (e.g., ACME, Inc.) as well as classes of individuals, organizations, systems or groups (e.g., the finance sector).
The Identity SDO can capture basic identifying information, contact information, and the sectors that the Identity belongs to. Identity is used in STIX to represent, among other things, targets of attacks, information sources, object creators, and threat actor identities.
Index ¶
- type Identity
- func (o *Identity) AddSectors(values interface{}) error
- func (o *Identity) Encode() ([]byte, error)
- func (o *Identity) EncodeToString() (string, error)
- func (o *Identity) GetPropertyList() []string
- func (o *Identity) SetContactInformation(s string) error
- func (o *Identity) SetIdentityClass(s string) error
- func (o *Identity) UnmarshalJSON(b []byte) error
- func (o *Identity) Valid() (bool, int, []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Identity ¶
type Identity struct {
objects.CommonObjectProperties
properties.NameProperty
properties.DescriptionProperty
properties.RolesProperty
IdentityClass string `json:"identity_class,omitempty" bson:"identity_class,omitempty"`
Sectors []string `json:"sectors,omitempty" bson:"sectors,omitempty"`
ContactInformation string `json:"contact_information,omitempty" bson:"contact_information,omitempty"`
}
Identity - This type implements the STIX 2 Identity SDO and defines all of the properties and methods needed to create and work with this object. All of the methods not defined local to this type are inherited from the individual properties.
func Decode ¶ added in v0.6.1
Decode - This function is a simple wrapper for decoding JSON data. It will decode a slice of bytes into an actual struct and return a pointer to that object along with any errors.
func New ¶
func New() *Identity
New - This function will create a new STIX Identity object and return it as a pointer.
func (*Identity) AddSectors ¶ added in v0.6.1
AddSectors - This method takes in a string value, a comma separated list of string values, or a slice of string values that represents a sector and adds it to the sectors property.
func (*Identity) Encode ¶ added in v0.6.1
Encode - This method is a simple wrapper for encoding an object into JSON
func (*Identity) EncodeToString ¶ added in v0.6.1
EncodeToString - This method is a simple wrapper for encoding an object into JSON
func (*Identity) GetPropertyList ¶ added in v0.6.1
GetPropertyList - This method will return a list of all of the properties that are unique to this object. This is used by the custom UnmarshalJSON for this object. It is defined here in this file to make it easy to keep in sync.
func (*Identity) SetContactInformation ¶
SetContactInformation - This method takes in a string value representing contact information as a text string and updates the contact information property.
func (*Identity) SetIdentityClass ¶
SetIdentityClass - This method takes in a string value representing a STIX identity class from the vocab identity-class-ov and updates the identity class property.
func (*Identity) UnmarshalJSON ¶ added in v0.6.1
UnmarshalJSON - This method will over write the default UnmarshalJSON method to enable custom properties that this library does not know about. It will store them as map where the value of each key is a byte arrays. This way a tool that does know how to deal with them can then further process them after this is done. This will also allow the storage of the raw JSON data.
func (*Identity) Valid ¶ added in v0.6.1
Valid - This method will verify and test all of the properties on an object to make sure they are valid per the specification. It will return a boolean, an integer that tracks the number of problems found, and a slice of strings that contain the detailed results, whether good or bad.