Tabnine Logo
ECKey.getPrivKeyBytes
Code IndexAdd Tabnine to your IDE (free)

How to use
getPrivKeyBytes
method
in
io.yggdrash.common.crypto.ECKey

Best Java code snippets using io.yggdrash.common.crypto.ECKey.getPrivKeyBytes (Showing top 4 results out of 315)

origin: yggdrash/yggdrash

    WALLET_PBKDF2_ALGORITHM);
byte[] encData = AESEncrypt.encrypt(
    key.getPrivKeyBytes(),
    ByteUtil.parseBytes(kdfPass, 0, 16),
    iv);
origin: yggdrash/yggdrash

@Test
public void testGetPrivKeyBytes() {
  ECKey key = new ECKey();
  assertNotNull(key.getPrivKeyBytes());
  assertEquals(32, key.getPrivKeyBytes().length);
}
origin: yggdrash/yggdrash

@Test
public void testEthereumSign() {
  ECKey key = ECKey.fromPrivate(privateKey);
  log.debug("Secret\t: " + Hex.toHexString(key.getPrivKeyBytes()));
  log.debug("Pubkey\t: " + Hex.toHexString(key.getPubKey()));
  log.debug("Data\t: " + exampleMessage);
  byte[] messageHash = HashUtil.sha3(exampleMessage.getBytes());
  ECDSASignature signature = key.sign(messageHash);
  String output = signature.toBase64();
  log.debug("Sign\t: " + output + " (Base64, length: " + output.length() + ")");
  assertEquals(sigBase64, output);
}
origin: yggdrash/yggdrash

@Test
public void testECKey() {
  ECKey key = new ECKey();
  assertTrue(key.isPubKeyCanonical());
  assertNotNull(key.getPubKey());
  assertNotNull(key.getPrivKeyBytes());
  log.debug(Hex.toHexString(key.getPrivKeyBytes()) + " :Generated privkey");
  log.debug(Hex.toHexString(key.getPubKey()) + " :Generated pubkey");
}
io.yggdrash.common.cryptoECKeygetPrivKeyBytes

Javadoc

Returns a 32 byte array containing the private key, or null if the key is encrypted or public only

Popular methods of ECKey

  • <init>
    Generates an entirely new keypair with the given SecureRandom object. BouncyCastle will be used as
  • doSign
    Signs the given hash and returns the R and S components as BigIntegers and put them in ECDSASignatur
  • fromPrivate
    Creates an ECKey given the private key only.
  • fromPublicOnly
    Creates an ECKey that cannot be used for signing, only verifying signatures, from the given encoded
  • getAddress
    Gets the address form of the public key.
  • getNodeId
    Generates the NodeID based on this key, that is the public key without first format byte
  • getPubKey
    Gets the encoded public key value.
  • isPubKeyCanonical
    Returns true if the given pubkey is canonical, i.e. the correct length taking into wallet compressio
  • recoverPubBytesFromSignature
    Given the components of a signature and a selector value, recover and return the public key that gen
  • sign
    Takes the keccak hash (32 bytes) of data and returns the ECDSA signature
  • signatureToKey
    Compute the key that signed the given signature.
  • verify
    Verifies the given ASN.1 encoded ECDSA signature against a hash using the public key.
  • signatureToKey,
  • verify,
  • check,
  • computeAddress,
  • decompressKey,
  • equals,
  • extractPublicKey,
  • fromNodeId,
  • getPubKeyPoint

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • runOnUiThread (Activity)
  • setScale (BigDecimal)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • JFileChooser (javax.swing)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now