Package org.keyczar.exceptions

Examples of org.keyczar.exceptions.KeyczarException


    @Override
    public void updateSign(ByteBuffer input) throws KeyczarException {
      try {
        signature.update(input);
      } catch (SignatureException e) {
        throw new KeyczarException(e);
      }
    }
View Full Code Here


    try {
      if (paddingFlag != null) {
        return RsaPadding.valueOf(paddingFlag.toUpperCase());
      }
    } catch (IllegalArgumentException e) {
      throw new KeyczarException(Messages.getString("InvalidPadding", paddingFlag));
    }
    return null;
  }
View Full Code Here

  public int getKeySize() throws KeyczarException {
    if (flagMap.containsKey(Flag.SIZE)) {
      try {
        return Integer.parseInt(flagMap.get(Flag.SIZE));
      } catch (NumberFormatException e) {
        throw new KeyczarException("Error parsing key size", e);
      }
    } else {
      return -1;
    }
  }
View Full Code Here

    public boolean verify(ByteBuffer sig) throws KeyczarException {
      try {
        return signature.verify(sig.array(), sig.position(), sig.limit()
            - sig.position());
      } catch (GeneralSecurityException e) {
        throw new KeyczarException(e);
      }
    }
View Full Code Here

    public HmacStream() throws KeyczarException {
      try {
        hmac = Mac.getInstance(MAC_ALGORITHM);
      } catch (GeneralSecurityException e) {
        throw new KeyczarException(e);
      }
    }
View Full Code Here

    public void initSign() throws KeyczarException {
      try {
        hmac.init(hmacKey);
      } catch (GeneralSecurityException e) {
        throw new KeyczarException(e);
      }
    }
View Full Code Here

    try {
      KeyFactory kf = KeyFactory.getInstance(KEY_GEN_ALGORITHM);
      jcePrivateKey = (DSAPrivateKey) kf.generatePrivate(spec);
     
    } catch (GeneralSecurityException e) {
      throw new KeyczarException(e);
    }
  }
View Full Code Here

    DsaPrivateKey key = new DsaPrivateKey();
    KeyPairGenerator kpg;
    try {
      kpg = KeyPairGenerator.getInstance(KEY_GEN_ALGORITHM);
    } catch (GeneralSecurityException e) {
      throw new KeyczarException(e);
    }
    key.size = keySize;
    kpg.initialize(key.size());
    KeyPair pair = kpg.generateKeyPair();
    key.jcePrivateKey = (DSAPrivateKey) pair.getPrivate();
View Full Code Here

    public DsaSigningStream() throws KeyczarException {
      try {
        signature = Signature.getInstance(SIG_ALGORITHM);
        verifyingStream = (VerifyingStream) publicKey.getStream();
      } catch (GeneralSecurityException e) {
        throw new KeyczarException(e);
      }
    }
View Full Code Here

    public void initSign() throws KeyczarException {
      try {
        signature.initSign(jcePrivateKey);
      } catch (GeneralSecurityException e) {
        throw new KeyczarException(e);
      }
    }
View Full Code Here

TOP

Related Classes of org.keyczar.exceptions.KeyczarException

Copyright © 2018 www.massapicom. 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.