View Source SmeeView.Aspects.EncryptionMethod (SmeeView v0.2.0)

Represents and processes <EncryptionMethod> elements in entity metadata as Aspect structs.

The functions in this module are intended to be applied to individual Aspect structs - for extracting and processing collections of these records please use the matching View module.

Summary

Functions

Returns the name/text for this algorithm.

Is this aspect relevant to the IdP role?

Returns the associated role for this aspect: :sp, :idp or :all

Is this aspect relevant to the SP role?

Removes the namespace for the algorithm, leaving a smaller, friendlier, potentially colliding name

Types

@type t() :: %SmeeView.Aspects.EncryptionMethod{algorithm: binary()}

Functions

@spec algorithm(aspect :: t()) :: binary()

Returns the name/text for this algorithm.

Aspects containing text are printable and can be converted to strings using Kernel.to_string/1 or interpolated into another string.

EncryptionMethod.algorithm(aspect)
# => "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1"
@spec idp?(aspect :: t()) :: boolean()

Is this aspect relevant to the IdP role?

Will return true if the aspect has been derived from an IdP role, or is applicable to all roles.

EncryptionMethod.idp?(aspect)
# => true
@spec role(aspect :: t()) :: atom()

Returns the associated role for this aspect: :sp, :idp or :all

The role type is useful when handling a mixed list of aspects that may be specific to certain roles of an entity.

EncryptionMethod.role(aspect)
# => :idp
@spec sp?(aspect :: t()) :: boolean()

Is this aspect relevant to the SP role?

Will return true if the aspect has been derived from an SP role, or is applicable to all roles.

EncryptionMethod.sp?(aspect)
# => false
@spec truncate(aspect :: t()) :: binary()

Removes the namespace for the algorithm, leaving a smaller, friendlier, potentially colliding name

EncryptionMethod.truncate(aspect)
# => "ecdsa-sha1"