Class Cipher

java.lang.Object
org.mozilla.jss.crypto.Cipher
Direct Known Subclasses:
PK11Cipher

public abstract class Cipher extends Object
A context for performing symmetric encryption and decryption. First, the context must be initialized. Then, it can be updated with input through zero or more calls to update. Finally, doFinal is called to finalize the operation. Note that it is not necessary to call update if all of the data is available at once. In this case, all of the input can be processed with one call to doFinal.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract byte[]
    Completes an cipher operation.
    abstract byte[]
    doFinal(byte[] bytes)
    Completes an cipher operation.
    abstract byte[]
    doFinal(byte[] bytes, int offset, int length)
    Completes an cipher operation.
    abstract void
    Initializes a decryption context with a symmetric key.
    abstract void
    Initializes a decryption context with a symmetric key and algorithm parameters.
    abstract void
    Initializes a encryption context with a symmetric key.
    abstract void
    Initializes an encryption context with a symmetric key and algorithm parameters.
    static byte[]
    pad(byte[] toBePadded, int blockSize)
    Pads a byte array so that its length is a multiple of the given blocksize.
    static byte[]
    unPad(byte[] padded)
    Un-pads a byte array that is padded with PKCS padding.
    static byte[]
    unPad(byte[] padded, int blockSize)
    Un-pads a byte array that is padded with PKCS padding.
    abstract byte[]
    update(byte[] bytes)
    Updates the encryption context with additional input.
    abstract byte[]
    update(byte[] bytes, int offset, int length)
    Updates the encryption context with additional plaintext.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait