class AWS::IAM::SigningCertificate
certificate. Status may be :active or :inactive.
@attr_reader [Symbol] status The status of this signing
signing certificate.
@attr_reader [String] contents Returns the contents of this
#=> ‘someuser’
user.name
user = iam.users.signing_certificates.first
belongs to the AWS account, then {#user} will return nil.
A certificate can also return the user it belongs to. If the certificate
== User
—–END CERTIFICATE—–
F9TbdXSWdgMl7E0=
Glli79yh87PRi0vNDlFEoHXNynkvC/c4TiWruZ4haM9BR9EdWr1DBNNu73ui093K
.…..
MIICdzCCAeCgAwIBAgIFGS4fY6owDQYJKoZIhvcNAQEFBQAwUzELMAkGA1UEBhMC
—–BEGIN CERTIFICATE—–
> puts certificate.contents
You can access the certificate contents you uploaded:
== Contents
#=> false
certificate.active?
certificate.deactivate!
#=> :active
certificate.status
certificate = iam.signing_certificates.upload(cert_body)
By default, newly-uploaded certifictes are active.
Signing certificates can be activated and deactivated.
def activate!
-
(nil)-
def activate! self.status = 'Active' nil end
def active?
-
(Boolean)- Returns true if this signing certificate is active.
def active? status == :active end
def deactivate!
-
(nil)-
def deactivate! self.status = 'Inactive' nil end
def delete
def delete client.delete_signing_certificate(resource_options) nil end
def get_resource attribute
def get_resource attribute options = user ? { :user_name => user.name } : {} client.list_signing_certificates(options) end
def inactive?
-
(Boolean)- Returns true if this signing certificate is inactive.
def inactive? status == :inactive end
def initialize certificate_id, options = {}
(**options)-
:user(User) --
Parameters:
-
options(Hash) -- -
certificate_id(String) -- The id of the signing certificate.
def initialize certificate_id, options = {} @id = certificate_id @user = options[:user] @user ? super(@user, options) : super(options) end
def matches_response_object? obj
def matches_response_object? obj user_name = obj.respond_to?(:user_name) ? obj.user_name : nil obj.certificate_id == self.id and user_name == self.user_name end
def resource_identifiers
def resource_identifiers identifiers = [] identifiers << [:certificate_id, id] identifiers << [:user_name, user.name] if user identifiers end
def user_name
-
(String, nil)- Returns the name of the user this certificate
def user_name @user ? @user.name : nil end