lib/slosilo/key.rb in slosilo-0.4.1 vs lib/slosilo/key.rb in slosilo-1.0.0
- old
+ new
@@ -96,9 +96,19 @@
alias_method :eql?, :==
def hash
to_der.hash
end
+
+ # return a new key with just the public part of this
+ def public
+ Key.new(@key.public_key)
+ end
+
+ # checks if the keypair contains a private key
+ def private?
+ @key.private?
+ end
private
# Note that this is currently somewhat shallow stringification --
# to implement originating tokens we may need to make it deeper.