GstSdp.MIKEYMessage

Fields

Name Type Access Description
CSB_id int r/w Identifies the Crypto Session Bundle
V bool r/w verify flag
map_info [object] r/w map info array of type depending on map_type
map_type GstSdp.MIKEYMapType r/w a GstSdp.MIKEYMapType
mini_object Gst.MiniObject r  
payloads [object] r/w the payload array of GstSdp.MIKEYPayload
prf_func GstSdp.MIKEYPRFFunc r/w a GstSdp.MIKEYPRFFunc
type GstSdp.MIKEYType r/w the GstSdp.MIKEYType message type
version int r/w the version

Methods

class new ()
class new_from_bytes (bytes, info)
class new_from_caps (caps)
class new_from_data (data, info)
  add_cs_srtp (policy, ssrc, roc)
  add_payload (payload)
  add_pke (C, data)
  add_rand (rand)
  add_rand_len (len)
  add_t (type, ts_value)
  add_t_now_ntp_utc ()
  base64_encode ()
  find_payload (type, nth)
  get_cs_srtp (idx)
  get_n_cs ()
  get_n_payloads ()
  get_payload (idx)
  insert_cs_srtp (idx, map)
  insert_payload (idx, payload)
  remove_cs_srtp (idx)
  remove_payload (idx)
  replace_cs_srtp (idx, map)
  replace_payload (idx, payload)
  set_info (version, type, V, prf_func, CSB_id, map_type)
  to_bytes (info)
  to_caps (caps)

Details

class GstSdp.MIKEYMessage

Structure holding the information of the MIKEY message

classmethod new()[source]
Returns:a new GstSdp.MIKEYMessage on success
Return type:GstSdp.MIKEYMessage

Make a new MIKEY message.

New in version 1.4.

classmethod new_from_bytes(bytes, info)[source]
Parameters:
Raises:

GLib.Error

Returns:

a new GstSdp.MIKEYMessage

Return type:

GstSdp.MIKEYMessage

Make a new GstSdp.MIKEYMessage from bytes.

New in version 1.4.

classmethod new_from_caps(caps)[source]
Parameters:caps (Gst.Caps) – a Gst.Caps, including SRTP parameters (srtp/srtcp cipher, authorization, key data)
Returns:a GstSdp.MIKEYMessage, or None if there is no srtp information in the caps.
Return type:GstSdp.MIKEYMessage

Makes mikey message including:

  • Security Policy Payload
  • Key Data Transport Payload
  • Key Data Sub-Payload

New in version 1.8.

classmethod new_from_data(data, info)[source]
Parameters:
Raises:

GLib.Error

Returns:

a GstSdp.MIKEYMessage on success or None when parsing failed and error will be set.

Return type:

GstSdp.MIKEYMessage

Parse size bytes from data into a GstSdp.MIKEYMessage. info contains the parameters to decrypt and verify the data.

New in version 1.4.

add_cs_srtp(policy, ssrc, roc)[source]
Parameters:
  • policy (int) – The security policy applied for the stream with ssrc
  • ssrc (int) – the SSRC that must be used for the stream
  • roc (int) – current rollover counter
Returns:

True on success

Return type:

bool

Add a Crypto policy for SRTP to self.

New in version 1.4.

add_payload(payload)[source]
Parameters:payload (GstSdp.MIKEYPayload) – a GstSdp.MIKEYPayload
Returns:True on success
Return type:bool

Add a new payload to self.

New in version 1.4.

add_pke(C, data)[source]
Parameters:
Returns:

True on success

Return type:

bool

Add a new PKE payload to self with the given parameters.

New in version 1.4.

add_rand(rand)[source]
Parameters:rand (bytes) – random data
Returns:True on success
Return type:bool

Add a new RAND payload to self with the given parameters.

New in version 1.4.

add_rand_len(len)[source]
Parameters:len (int) – length
Returns:True on success
Return type:bool

Add a new RAND payload to self with len random bytes.

New in version 1.4.

add_t(type, ts_value)[source]
Parameters:
  • type (GstSdp.MIKEYTSType) – specifies the timestamp type used
  • ts_value (bytes) – The timestamp value of the specified type
Returns:

True on success

Return type:

bool

Add a new T payload to self with the given parameters.

New in version 1.4.

add_t_now_ntp_utc()[source]
Returns:True on success
Return type:bool

Add a new T payload to self that contains the current time in NTP-UTC format.

New in version 1.4.

base64_encode()[source]
Returns:a str, base64-encoded data
Return type:str

New in version 1.8.

find_payload(type, nth)[source]
Parameters:
Returns:

the nth GstSdp.MIKEYPayload of type.

Return type:

GstSdp.MIKEYPayload

Find the nth occurrence of the payload with type in self.

New in version 1.4.

get_cs_srtp(idx)[source]
Parameters:idx (int) – an index
Returns:a GstSdp.MIKEYMapSRTP
Return type:GstSdp.MIKEYMapSRTP

Get the policy information of self at idx.

New in version 1.4.

get_n_cs()[source]
Returns:the number of crypto sessions
Return type:int

Get the number of crypto sessions in self.

New in version 1.4.

get_n_payloads()[source]
Returns:the number of payloads in self
Return type:int

Get the number of payloads in self.

New in version 1.4.

get_payload(idx)[source]
Parameters:idx (int) – an index
Returns:the GstSdp.MIKEYPayload at idx. The payload remains valid for as long as it is part of self.
Return type:GstSdp.MIKEYPayload

Get the GstSdp.MIKEYPayload at idx in self

New in version 1.4.

insert_cs_srtp(idx, map)[source]
Parameters:
Returns:

True on success

Return type:

bool

Insert a Crypto Session map for SRTP in self at idx

When idx is -1, the policy will be appended.

New in version 1.4.

insert_payload(idx, payload)[source]
Parameters:
Returns:

True on success

Return type:

bool

Insert the payload at index idx in self. If idx is -1, the payload will be appended to self.

New in version 1.4.

remove_cs_srtp(idx)[source]
Parameters:idx (int) – the index to remove
Returns:True on success
Return type:bool

Remove the SRTP policy at idx.

New in version 1.4.

remove_payload(idx)[source]
Parameters:idx (int) – an index
Returns:True on success
Return type:bool

Remove the payload in self at idx

New in version 1.4.

replace_cs_srtp(idx, map)[source]
Parameters:
Returns:

True on success

Return type:

bool

Replace a Crypto Session map for SRTP in self at idx with map.

New in version 1.4.

replace_payload(idx, payload)[source]
Parameters:
Returns:

True on success

Return type:

bool

Replace the payload at idx in self with payload.

New in version 1.4.

set_info(version, type, V, prf_func, CSB_id, map_type)[source]
Parameters:
Returns:

True on success

Return type:

bool

Set the information in self.

New in version 1.4.

to_bytes(info)[source]
Parameters:info (GstSdp.MIKEYEncryptInfo) – a GstSdp.MIKEYEncryptInfo
Raises:GLib.Error
Returns:a new GLib.Bytes for self.
Return type:GLib.Bytes

Convert self to a GLib.Bytes.

New in version 1.4.

to_caps(caps)[source]
Parameters:caps (Gst.Caps) – a Gst.Caps to be filled with SRTP parameters (srtp/srtcp cipher, authorization, key data)
Returns:True on success
Return type:bool

New in version 1.8.1.