View Source SmeeView.Aspects.Key (SmeeView v0.2.1)
Represents and processes <KeyDescriptor> elements in entity metadata as Aspect structs.
This is information about the keys used by an IdP or SP for signing and encryption and contains the public key
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 raw BASE64 string data of the key, without PEM headers, as stored in the metadata
Is the key suitable for encryption use?
Returns the expiry date (Not After) for the certificate
Returns the SHA1 fingerprint of the certificate
Is this aspect relevant to the IdP role?
Returns the issuer CN of the certificate
Returns the public key as a PEM string (a BASE64-encoded DER certificate).
Returns the associated role for this aspect: :sp, :idp or :all
Returns the serial number for the certificate
Return the signature algorithm as a string (not a list!)
Is the key suitable for signing use?
Is this aspect relevant to the SP role?
Returns the subject CN of the key/certificate
Return the key type: signing, encryption or nil. Nil indicates that the key is general-purpose.
Types
Functions
Returns the raw BASE64 string data of the key, without PEM headers, as stored in the metadata
Key.data(aspect)
# => "MIICMzCCAZygAwIBAgIJALiPnVsvq..."
Is the key suitable for encryption use?
Not that this is used for, not specifically for - a type of nil indicates both signing and encryption use.
Key.encryption?(aspect)
# => true
Returns the expiry date (Not After) for the certificate
Key.expires_at(aspect)
# => ~U[2023-05-21 16:12:05.481701Z]
Returns the SHA1 fingerprint of the certificate
Key.fingerprint(aspect)
# => "A5:9C:E0:47:C1:34:88:9F:16:0B:15:0C:9E:A1:B9:05:6D:8C:37:FE"
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.
Key.idp?(aspect)
# => true
Returns the issuer CN of the certificate
Key.issuer(aspect)
# => "CN=Ankh Morpork Post Office"
Returns the public key as a PEM string (a BASE64-encoded DER certificate).
Key.pem(aspect)
# => "-----BEGIN CERTIFICATE-----
#MIICMzCCAZygAwIBAgIJALiPnVsvq..."
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.
Key.role(aspect)
# => :idp
Returns the serial number for the certificate
Key.serial_number(aspect)
# => "27ACAE30B9F323"
Return the signature algorithm as a string (not a list!)
Key.signature_algorithm(aspect)
# => "sha, rsa"
Is the key suitable for signing use?
Not that this is used for, not specifically for - a type of nil indicates both signing and encryption use.
Key.signing?(aspect)
# => false
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.
Key.sp?(aspect)
# => false
Returns the subject CN of the key/certificate
Key.subject(aspect)
# => "/CN=hex.unseen.edu/OU=Domain Control Validated"
Return the key type: signing, encryption or nil. Nil indicates that the key is general-purpose.
Key.type(aspect)
# => "signing"