Class: Rex::Proto::CryptoAsn1::ObjectId

Inherits:
OpenSSL::ASN1::ObjectId
  • Object
show all
Defined in:
lib/rex/proto/crypto_asn1/o_i_ds.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args, label: nil, name: nil) ⇒ ObjectId

Returns a new instance of ObjectId.



8
9
10
11
12
# File 'lib/rex/proto/crypto_asn1/o_i_ds.rb', line 8

def initialize(*args, label: nil, name: nil)
  @label = label
  @name = name
  super(*args)
end

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



7
8
9
# File 'lib/rex/proto/crypto_asn1/o_i_ds.rb', line 7

def label
  @label
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/rex/proto/crypto_asn1/o_i_ds.rb', line 7

def name
  @name
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


14
15
16
17
18
# File 'lib/rex/proto/crypto_asn1/o_i_ds.rb', line 14

def eql?(other)
  return false unless other.is_a?(self.class)
  return false unless other.value == value
  true
end

#microsoft?Boolean

Returns whether or not this OID is one of Microsoft’s

Returns:

  • (Boolean)


23
24
25
# File 'lib/rex/proto/crypto_asn1/o_i_ds.rb', line 23

def microsoft?
  @value.start_with?('1.3.6.1.4.1.311.') || @value == '1.3.6.1.4.1.311'
end