Class: R509::Cert::Extensions::ExtendedKeyUsage
- Inherits:
-
OpenSSL::X509::Extension
- Object
- OpenSSL::X509::Extension
- R509::Cert::Extensions::ExtendedKeyUsage
- Defined in:
- lib/r509/cert/extensions.rb
Overview
Implements the ExtendedKeyUsage certificate extension, with methods to provide access to the components and meaning of the extension's contents.
Constant Summary
- OID =
"extendedKeyUsage"
- AU_WEB_SERVER_AUTH =
The OpenSSL friendly name for the "serverAuth" extended key use.
"TLS Web Server Authentication"
- AU_WEB_CLIENT_AUTH =
The OpenSSL friendly name for the "clientAuth" extended key use.
"TLS Web Client Authentication"
- AU_CODE_SIGNING =
The OpenSSL friendly name for the "codeSigning" extended key use.
"Code Signing"
- AU_EMAIL_PROTECTION =
The OpenSSL friendly name for the "emailProtection" extended key use.
"E-mail Protection"
Instance Attribute Summary (collapse)
-
- (Object) allowed_uses
readonly
An array of the key uses allowed.
Instance Method Summary (collapse)
-
- (Boolean) allows?(friendly_use_name)
Returns true if the given use is allowed by this extension.
- - (Boolean) code_signing?
- - (Boolean) email_protection?
-
- (ExtendedKeyUsage) initialize(*args)
constructor
See OpenSSL::X509::Extension#initialize.
- - (Boolean) web_client_authentication?
- - (Boolean) web_server_authentication?
Constructor Details
- (ExtendedKeyUsage) initialize(*args)
See OpenSSL::X509::Extension#initialize
151 152 153 154 155 |
# File 'lib/r509/cert/extensions.rb', line 151 def initialize(*args) super(*args) @allowed_uses = self.value.split(",").map {|use| use.strip} end |
Instance Attribute Details
- (Object) allowed_uses (readonly)
An array of the key uses allowed. See the AU_* constants in this class.
148 149 150 |
# File 'lib/r509/cert/extensions.rb', line 148 def allowed_uses @allowed_uses end |
Instance Method Details
- (Boolean) allows?(friendly_use_name)
Returns true if the given use is allowed by this extension.
159 160 161 |
# File 'lib/r509/cert/extensions.rb', line 159 def allows?( friendly_use_name ) @allowed_uses.include?( friendly_use_name ) end |
- (Boolean) code_signing?
171 172 173 |
# File 'lib/r509/cert/extensions.rb', line 171 def code_signing? allows?( AU_CODE_SIGNING ) end |
- (Boolean) email_protection?
175 176 177 |
# File 'lib/r509/cert/extensions.rb', line 175 def email_protection? allows?( AU_EMAIL_PROTECTION ) end |
- (Boolean) web_client_authentication?
167 168 169 |
# File 'lib/r509/cert/extensions.rb', line 167 def web_client_authentication? allows?( AU_WEB_CLIENT_AUTH ) end |
- (Boolean) web_server_authentication?
163 164 165 |
# File 'lib/r509/cert/extensions.rb', line 163 def web_server_authentication? allows?( AU_WEB_SERVER_AUTH ) end |