Class: Ccrypto::X509Cert
- Inherits:
-
Object
show all
- Includes:
- TR::CondUtils
- Defined in:
- lib/ccrypto/java/ext/x509_cert.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(mtd, *args, &block) ⇒ Object
11
12
13
|
# File 'lib/ccrypto/java/ext/x509_cert.rb', line 11
def method_missing(mtd, *args, &block)
@nativeX509.send(mtd, *args, &block)
end
|
Class Method Details
.to_java_cert(cert) ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/ccrypto/java/ext/x509_cert.rb', line 31
def self.to_java_cert(cert)
raise X509CertException, "Given certificate to convert to Java certificate object is empty" if is_empty?(cert)
case cert
when java.security.cert.Certificate
cert
when org.bouncycastle.cert.X509CertificateHolder
cert.to_java_cert
when Ccrypto::X509Cert
to_java_cert(cert.nativeX509)
else
raise X509CertException, "Unknown certificate type #{cert} for conversion"
end
end
|
Instance Method Details
#equal?(cert) ⇒ Boolean
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/ccrypto/java/ext/x509_cert.rb', line 15
def equal?(cert)
if cert.nil?
if @nativeX509.nil?
true
else
false
end
else
tcert = self.class.to_java_cert(cert)
lcert = self.class.to_java_cert(@nativeX509)
tcert.encoded == @nativeX509.encoded
end
end
|
#to_der ⇒ Object
7
8
9
|
# File 'lib/ccrypto/java/ext/x509_cert.rb', line 7
def to_der
@nativeX509.encoded
end
|