Class: Sigstore::Internal::X509::Extension::ExtendedKeyUsage
- Inherits:
-
Sigstore::Internal::X509::Extension
- Object
- Sigstore::Internal::X509::Extension
- Sigstore::Internal::X509::Extension::ExtendedKeyUsage
- Defined in:
- lib/sigstore/internal/x509.rb
Constant Summary collapse
- CODE_SIGNING =
OpenSSL::ASN1::ObjectId.new("1.3.6.1.5.5.7.3.3")
Instance Attribute Summary collapse
-
#purposes ⇒ Object
readonly
Returns the value of attribute purposes.
Instance Method Summary collapse
Methods inherited from Sigstore::Internal::X509::Extension
#critical?, #initialize, #shift_bitstring, #shift_value
Constructor Details
This class inherits a constructor from Sigstore::Internal::X509::Extension
Instance Attribute Details
#purposes ⇒ Object (readonly)
Returns the value of attribute purposes.
235 236 237 |
# File 'lib/sigstore/internal/x509.rb', line 235 def purposes @purposes end |
Instance Method Details
#code_signing? ⇒ Boolean
252 253 254 |
# File 'lib/sigstore/internal/x509.rb', line 252 def code_signing? purposes.any? { |purpose| purpose.oid == CODE_SIGNING.oid } end |
#parse_value(value) ⇒ Object
237 238 239 240 241 242 243 244 245 246 247 248 |
# File 'lib/sigstore/internal/x509.rb', line 237 def parse_value(value) unless value.is_a?(OpenSSL::ASN1::Sequence) rasie ArgumentError, "Invalid extended key usage: #{value.inspect}" end @purposes = value.value return if @purposes.all?(OpenSSL::ASN1::ObjectId) raise ArgumentError, "Invalid extended key usage: #{value.inspect}" end |