Class: OCI::CertificatesManagement::Models::CreateCertificateIssuedByInternalCaConfigDetails

Inherits:
CreateCertificateConfigDetails show all
Defined in:
lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb

Overview

The details of the configuration for creating an internally managed certificate which is issued by a private certificate authority (CA).

Constant Summary collapse

CERTIFICATE_PROFILE_TYPE_ENUM =
[
  CERTIFICATE_PROFILE_TYPE_TLS_SERVER_OR_CLIENT = 'TLS_SERVER_OR_CLIENT'.freeze,
  CERTIFICATE_PROFILE_TYPE_TLS_SERVER = 'TLS_SERVER'.freeze,
  CERTIFICATE_PROFILE_TYPE_TLS_CLIENT = 'TLS_CLIENT'.freeze,
  CERTIFICATE_PROFILE_TYPE_TLS_CODE_SIGN = 'TLS_CODE_SIGN'.freeze
].freeze
KEY_ALGORITHM_ENUM =
[
  KEY_ALGORITHM_RSA2048 = 'RSA2048'.freeze,
  KEY_ALGORITHM_RSA4096 = 'RSA4096'.freeze,
  KEY_ALGORITHM_ECDSA_P256 = 'ECDSA_P256'.freeze,
  KEY_ALGORITHM_ECDSA_P384 = 'ECDSA_P384'.freeze
].freeze
SIGNATURE_ALGORITHM_ENUM =
[
  SIGNATURE_ALGORITHM_SHA256_WITH_RSA = 'SHA256_WITH_RSA'.freeze,
  SIGNATURE_ALGORITHM_SHA384_WITH_RSA = 'SHA384_WITH_RSA'.freeze,
  SIGNATURE_ALGORITHM_SHA512_WITH_RSA = 'SHA512_WITH_RSA'.freeze,
  SIGNATURE_ALGORITHM_SHA256_WITH_ECDSA = 'SHA256_WITH_ECDSA'.freeze,
  SIGNATURE_ALGORITHM_SHA384_WITH_ECDSA = 'SHA384_WITH_ECDSA'.freeze,
  SIGNATURE_ALGORITHM_SHA512_WITH_ECDSA = 'SHA512_WITH_ECDSA'.freeze
].freeze

Constants inherited from CreateCertificateConfigDetails

OCI::CertificatesManagement::Models::CreateCertificateConfigDetails::CONFIG_TYPE_ENUM

Instance Attribute Summary collapse

Attributes inherited from CreateCertificateConfigDetails

#config_type, #version_name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CreateCertificateConfigDetails

get_subtype

Constructor Details

#initialize(attributes = {}) ⇒ CreateCertificateIssuedByInternalCaConfigDetails

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 110

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  attributes['configType'] = 'ISSUED_BY_INTERNAL_CA'

  super(attributes)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.certificate_profile_type = attributes[:'certificateProfileType'] if attributes[:'certificateProfileType']

  raise 'You cannot provide both :certificateProfileType and :certificate_profile_type' if attributes.key?(:'certificateProfileType') && attributes.key?(:'certificate_profile_type')

  self.certificate_profile_type = attributes[:'certificate_profile_type'] if attributes[:'certificate_profile_type']

  self.issuer_certificate_authority_id = attributes[:'issuerCertificateAuthorityId'] if attributes[:'issuerCertificateAuthorityId']

  raise 'You cannot provide both :issuerCertificateAuthorityId and :issuer_certificate_authority_id' if attributes.key?(:'issuerCertificateAuthorityId') && attributes.key?(:'issuer_certificate_authority_id')

  self.issuer_certificate_authority_id = attributes[:'issuer_certificate_authority_id'] if attributes[:'issuer_certificate_authority_id']

  self.validity = attributes[:'validity'] if attributes[:'validity']

  self.subject = attributes[:'subject'] if attributes[:'subject']

  self.subject_alternative_names = attributes[:'subjectAlternativeNames'] if attributes[:'subjectAlternativeNames']

  raise 'You cannot provide both :subjectAlternativeNames and :subject_alternative_names' if attributes.key?(:'subjectAlternativeNames') && attributes.key?(:'subject_alternative_names')

  self.subject_alternative_names = attributes[:'subject_alternative_names'] if attributes[:'subject_alternative_names']

  self.key_algorithm = attributes[:'keyAlgorithm'] if attributes[:'keyAlgorithm']

  raise 'You cannot provide both :keyAlgorithm and :key_algorithm' if attributes.key?(:'keyAlgorithm') && attributes.key?(:'key_algorithm')

  self.key_algorithm = attributes[:'key_algorithm'] if attributes[:'key_algorithm']

  self.signature_algorithm = attributes[:'signatureAlgorithm'] if attributes[:'signatureAlgorithm']

  raise 'You cannot provide both :signatureAlgorithm and :signature_algorithm' if attributes.key?(:'signatureAlgorithm') && attributes.key?(:'signature_algorithm')

  self.signature_algorithm = attributes[:'signature_algorithm'] if attributes[:'signature_algorithm']
end

Instance Attribute Details

#certificate_profile_typeString

[Required] The name of the profile used to create the certificate, which depends on the type of certificate you need.

Returns:

  • (String)


37
38
39
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 37

def certificate_profile_type
  @certificate_profile_type
end

#issuer_certificate_authority_idString

[Required] The OCID of the private CA.

Returns:

  • (String)


41
42
43
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 41

def issuer_certificate_authority_id
  @issuer_certificate_authority_id
end

#key_algorithmString

The algorithm to use to create key pairs.

Returns:

  • (String)


56
57
58
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 56

def key_algorithm
  @key_algorithm
end

#signature_algorithmString

The algorithm to use to sign the public key certificate.

Returns:

  • (String)


60
61
62
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 60

def signature_algorithm
  @signature_algorithm
end

#subjectOCI::CertificatesManagement::Models::CertificateSubject

This attribute is required.



48
49
50
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 48

def subject
  @subject
end

#subject_alternative_namesArray<OCI::CertificatesManagement::Models::CertificateSubjectAlternativeName>

A list of subject alternative names.



52
53
54
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 52

def subject_alternative_names
  @subject_alternative_names
end

#validityOCI::CertificatesManagement::Models::Validity



44
45
46
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 44

def validity
  @validity
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 63

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'config_type': :'configType',
    'version_name': :'versionName',
    'certificate_profile_type': :'certificateProfileType',
    'issuer_certificate_authority_id': :'issuerCertificateAuthorityId',
    'validity': :'validity',
    'subject': :'subject',
    'subject_alternative_names': :'subjectAlternativeNames',
    'key_algorithm': :'keyAlgorithm',
    'signature_algorithm': :'signatureAlgorithm'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 80

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'config_type': :'String',
    'version_name': :'String',
    'certificate_profile_type': :'String',
    'issuer_certificate_authority_id': :'String',
    'validity': :'OCI::CertificatesManagement::Models::Validity',
    'subject': :'OCI::CertificatesManagement::Models::CertificateSubject',
    'subject_alternative_names': :'Array<OCI::CertificatesManagement::Models::CertificateSubjectAlternativeName>',
    'key_algorithm': :'String',
    'signature_algorithm': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 186

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    config_type == other.config_type &&
    version_name == other.version_name &&
    certificate_profile_type == other.certificate_profile_type &&
    issuer_certificate_authority_id == other.issuer_certificate_authority_id &&
    validity == other.validity &&
    subject == other.subject &&
    subject_alternative_names == other.subject_alternative_names &&
    key_algorithm == other.key_algorithm &&
    signature_algorithm == other.signature_algorithm
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 224

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


204
205
206
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 204

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



213
214
215
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 213

def hash
  [config_type, version_name, certificate_profile_type, issuer_certificate_authority_id, validity, subject, subject_alternative_names, key_algorithm, signature_algorithm].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



257
258
259
260
261
262
263
264
265
266
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 257

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



251
252
253
# File 'lib/oci/certificates_management/models/create_certificate_issued_by_internal_ca_config_details.rb', line 251

def to_s
  to_hash.to_s
end