Class: Ccrypto::Java::ECCPublicKey

Inherits:
ECCPublicKey
  • Object
show all
Includes:
DataConversion
Defined in:
lib/ccrypto/java/engines/ecc_engine.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from DataConversion

#from_b64, #from_hex, included, #to_b64, #to_b64_mime, #to_hex, #to_java_bytes, #to_str

Class Method Details

.to_key(bin) ⇒ Object



20
21
22
23
24
# File 'lib/ccrypto/java/engines/ecc_engine.rb', line 20

def self.to_key(bin)
  bin = to_java_bytes(bin) if not bin.is_a?(::Java::byte[])
  pubKey = java.security.KeyFactory.getInstance("ECDSA", "BC").generatePublic(java.security.spec.X509EncodedKeySpec.new(bin))
  ECCPublicKey.new(pubKey)
end

Instance Method Details

#encodedObject



16
17
18
# File 'lib/ccrypto/java/engines/ecc_engine.rb', line 16

def encoded
  to_bin
end

#to_binObject



12
13
14
# File 'lib/ccrypto/java/engines/ecc_engine.rb', line 12

def to_bin
  @native_pubKey.encoded
end