Examples of ShortBufferException


Examples of javax.crypto.ShortBufferException

    {
        byte[] secret = engineGenerateSecret();

        if (sharedSecret.length - offset < secret.length)
        {
            throw new ShortBufferException(kaAlgorithm + " key agreement: need " + secret.length + " bytes");
        }

        System.arraycopy(secret, 0, sharedSecret, offset, secret.length);
       
        return secret.length;
View Full Code Here

Examples of javax.crypto.ShortBufferException

        {
            return cipher.processBytes(input, inputOffset, inputLen, output, outputOffset);
        }
        catch (DataLengthException e)
        {
            throw new ShortBufferException(e.getMessage());
        }
    }
View Full Code Here

Examples of javax.crypto.ShortBufferException

        return inputLen;
        }
        catch (DataLengthException e)
        {
            throw new ShortBufferException(e.getMessage());
        }
    }
View Full Code Here

Examples of org.keyczar.exceptions.ShortBufferException

      byte[] ivPreImage = new byte[BLOCK_SIZE];
      Util.rand(ivPreImage);
      try {
        return encryptingCipher.update(ByteBuffer.wrap(ivPreImage), output);
      } catch (javax.crypto.ShortBufferException e) {
        throw new ShortBufferException(e);
      }
    }
View Full Code Here

Examples of org.keyczar.exceptions.ShortBufferException

        ivRead = false;
      }
      try {
        return decryptingCipher.update(input, output);
      } catch (javax.crypto.ShortBufferException e) {
        throw new ShortBufferException(e);
      }
    }
View Full Code Here

Examples of org.keyczar.exceptions.ShortBufferException

    public int updateEncrypt(ByteBuffer input, ByteBuffer output)
        throws KeyczarException {
      try {
        return encryptingCipher.update(input, output);
      } catch (javax.crypto.ShortBufferException e) {
        throw new ShortBufferException(e);
      }
    }
View Full Code Here

Examples of org.keyczar.exceptions.ShortBufferException

    int spaceNeeded = digestSize();
    if (expirationTime > 0) {
      spaceNeeded += TIMESTAMP_SIZE;
    }
    if (output.capacity() < spaceNeeded) {
      throw new ShortBufferException(output.capacity(), spaceNeeded);
    }

    ByteBuffer header = ByteBuffer.allocate(HEADER_SIZE);
    signingKey.copyHeader(header);
    header.rewind();
View Full Code Here

Examples of org.keyczar.exceptions.ShortBufferException

      stream = (SigningStream) signingKey.getStream();
    }

    int spaceNeeded = digestSize();
    if (output.capacity() < spaceNeeded) {
      throw new ShortBufferException(output.capacity(), spaceNeeded);
    }

    stream.initSign();
    // Sign the header and write it to the output buffer
    output.mark();
View Full Code Here

Examples of org.keyczar.exceptions.ShortBufferException

    BadVersionException enEx = new BadVersionException((byte) 1);
    assertEquals(englishMessage, enEx.getMessage());
   
    String anotherEnglishMessage =
      "Input buffer is too short. Given: 20 bytes. Need: 10";
    ShortBufferException buffEx = new ShortBufferException(20, 10);
    assertEquals(anotherEnglishMessage, buffEx.getMessage());
  }
View Full Code Here

Examples of org.keyczar.exceptions.ShortBufferException

      byte[] ivPreImage = new byte[BLOCK_SIZE];
      Util.rand(ivPreImage);
      try {
        return encryptingCipher.update(ByteBuffer.wrap(ivPreImage), output);
      } catch (javax.crypto.ShortBufferException e) {
        throw new ShortBufferException(e);
      }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.