diff options
author | David Hook <dgh@cryptoworkshop.com> | 2013-05-20 10:32:54 +0400 |
---|---|---|
committer | David Hook <dgh@cryptoworkshop.com> | 2013-05-20 10:32:54 +0400 |
commit | 01a4148cbb7db83113bd6b45528e413d0b1d40cc (patch) | |
tree | 4141fa817c9c8fc4200970f219ca8a72dfe33e7f | |
parent | b1bbd3b14d495baee344b263020b338c07419980 (diff) |
added getEncoded()
-rw-r--r-- | src/main/java/org/bouncycastle/crypto/ec/ECPair.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/org/bouncycastle/crypto/ec/ECPair.java b/src/main/java/org/bouncycastle/crypto/ec/ECPair.java index 8f868dec..d910f3c7 100644 --- a/src/main/java/org/bouncycastle/crypto/ec/ECPair.java +++ b/src/main/java/org/bouncycastle/crypto/ec/ECPair.java @@ -22,4 +22,17 @@ public class ECPair { return y; } + + public byte[] getEncoded() + { + byte[] xEnc = x.getEncoded(); + byte[] yEnc = y.getEncoded(); + + byte[] full = new byte[xEnc.length + yEnc.length]; + + System.arraycopy(xEnc, 0, full, 0, xEnc.length); + System.arraycopy(yEnc, 0, full, xEnc.length, yEnc.length); + + return full; + } } |