mobile/android/base/browserid/SigningPrivateKey.java

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 package org.mozilla.gecko.browserid;
     7 import java.security.GeneralSecurityException;
     9 import org.mozilla.gecko.sync.ExtendedJSONObject;
    11 public interface SigningPrivateKey {
    12   /**
    13    * Return the JSON Web Token "alg" header corresponding to this private key.
    14    * <p>
    15    * The header is used when formatting web tokens, and generally denotes the
    16    * algorithm and an ad-hoc encoding of the key size.
    17    *
    18    * @return header.
    19    */
    20   public String getAlgorithm();
    22   /**
    23    * Generate a JSON representation of a private key.
    24    * <p>
    25    * <b>This should only be used for debugging. No private keys should go over
    26    * the wire at any time.</b>
    27    *
    28    * @param privateKey
    29    *          to represent.
    30    * @return JSON representation.
    31    */
    32   public ExtendedJSONObject toJSONObject();
    34   /**
    35    * Sign a message.
    36    * @param message to sign.
    37    * @return signature.
    38    * @throws GeneralSecurityException
    39    */
    40   public byte[] signMessage(byte[] message) throws GeneralSecurityException;
    41 }

mercurial