Class: Ccrypto::Java::Keystore::PKCS12Keystore

Inherits:
Object
  • Object
show all
Includes:
DataConversion, TR::CondUtils
Defined in:
lib/ccrypto/java/keystore/pkcs12_keystore.rb

Class Method Summary collapse

Methods included from DataConversion

#from_b64, #from_b64_mime, #from_hex, included, #logger, #to_b64, #to_b64_mime, #to_bin, #to_hex, #to_java_bytes, #to_str

Class Method Details

.from_p12(bin, &block) ⇒ Object

Raises:

  • (Ccrypto::Keystore::KeystoreException)


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ccrypto/java/keystore/pkcs12_keystore.rb', line 12

def self.from_p12(bin, &block)

  raise Ccrypto::Keystore::KeystoreException, "block is required" if not block

  JCEKeystore.from_keystore(bin, "PKCS12") do |k|
    case k
    when :logger
      logger
    when :jce_provider
      JCEProvider::DEFProv
    else
      block.call(k)
    end
  end
 
end

.to_p12(&block) ⇒ Object

from_p12

Raises:

  • (Ccrypto::Keystore::KeystoreException)


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/ccrypto/java/keystore/pkcs12_keystore.rb', line 29

def self.to_p12(&block)

  raise Ccrypto::Keystore::KeystoreException, "Block is required" if not block

  JCEKeystore.to_keystore("PKCS12") do |k|
    case k
    when :logger
      logger
    when :jce_provider
      JCEProvider::DEFProv
    else
      block.call(k)
    end
  end
 
end