Class AWS::IAM::SigningCertificate
In: lib/aws/iam/signing_certificate.rb
Parent: Resource

Signing certificates can be activated and deactivated. By default, newly-uploaded certifictes are active.

  certificate = iam.signing_certificates.upload(cert_body)
  certificate.status
  #=> :active

  certificate.deactivate!
  certificate.active?
  #=> false

Contents

You can access the certificate contents you uploaded:

  > puts certificate.contents
  -----BEGIN CERTIFICATE-----
  MIICdzCCAeCgAwIBAgIFGS4fY6owDQYJKoZIhvcNAQEFBQAwUzELMAkGA1UEBhMC
  ......
  Glli79yh87PRi0vNDlFEoHXNynkvC/c4TiWruZ4haM9BR9EdWr1DBNNu73ui093K
  F9TbdXSWdgMl7E0=
  -----END CERTIFICATE-----

User

A certificate can also return the user it belongs to. If the certificate belongs to the AWS account, then {user} will return nil.

  user = iam.users['someuser'].signing_certificates.first
  user.name
  #=> 'someuser'

@attr_reader [String] contents Returns the contents of this

  signing certificate.

@attr_reader [Symbol] status The status of this signing

  certificate.  Status may be +:active+ or +:inactive+.

Methods

Attributes

id  [R]  @return [String] Returns the signing certificate‘s ID.
user  [R]  @return [User,nil] Returns the user this cerficiate belongs to.
  Returns +nil+ if the cerficiate is a root credential for the
  account.  If the configured credentials belong to an IAM user,
  then that user is the implied owner.

Public Class methods

@param [String] certificate_id The id of the signing certificate. @param [Hash] options @param [User] :user The user this signing certificate belongs to.

Public Instance methods

Activates this signing cerificate.

@example

  signing_certificate.activate!
  signing_certificate.status
  # => :active

@return [nil]

@return [Boolean] Returns true if this signing certificate is active.

Deactivates this signing cerificate.

@example

  signing_certificate.deactivate!
  signing_certificate.status
  # => :inactive

@return [nil]

Deletes the signing certificate.

@return [Boolean] Returns true if this signing certificate is inactive.

@return [String,nil] Returns the name of the user this certificate

  belogns to.  If the certificate belongs to the account, +nil+ is
  returned.

Protected Instance methods

IAM does not provide a request for "get signing certificate". Also note, we do not page the response. This is because restrictions on how many certificates an account / user may have is fewer than one page of results. @private

[Validate]