Package codec

Examples of codec.InconsistentStateException


      return kf.generatePrivate(kspec);
  } catch (ASN1Exception e) {
      throw new UnrecoverableKeyException(e.getMessage());
  } catch (IOException e) {
      throw new InconsistentStateException("Caught IOException!");
  }
    }
View Full Code Here


      enc = new DEREncoder(bos);
      key.encode(enc);
      code = bos.toByteArray();
      enc.close();
  } catch (IOException e) {
      throw new InconsistentStateException("Caught IOException!");
  } catch (ASN1Exception e) {
      throw new InconsistentStateException("Caught ASN1Exception!");
  }
  encodedKey_ = new ASN1OctetString(code);
  add(encodedKey_);

  attributes_ = new ASN1Set();
View Full Code Here

      alg = algorithm_.getAlgorithmOID().toString();
      kf = KeyFactory.getInstance(alg);

      return kf.generatePrivate(spec);
  } catch (ASN1Exception e) {
      throw new InconsistentStateException("Internal, encoding error!");
  } catch (IOException e) {
      throw new InconsistentStateException(
        "Internal, I/O exception caught!");
  } catch (InvalidKeySpecException e) {
      throw new InconsistentStateException(
        "Encoded key spec rejected by key factory!");
  }
    }
View Full Code Here

      key.encode(enc);
      encodedKey_ = new ASN1OctetString(bos.toByteArray());
      enc.close();
      set(2, encodedKey_);
  } catch (ASN1Exception e) {
      throw new InconsistentStateException("Internal, encoding error!");
  } catch (IOException e) {
      throw new InconsistentStateException(
        "Internal, I/O exception caught!");
  }
    }
View Full Code Here

      return raw;
  } catch (ASN1Exception e) {
      throw new CorruptedCodeException("Cannot decode raw key!");
  } catch (IOException e) {
      throw new InconsistentStateException(
        "Internal, I/O exception caught!");
  }
    }
View Full Code Here

    bos.close();
      }
      add(algorithm_);
      add(parameters_);
  } catch (IOException e) {
      throw new InconsistentStateException(
        "Internal, caught IOException!");
  }
    }
View Full Code Here

      dAlg_ = new AlgorithmIdentifier(new ASN1ObjectIdentifier(d),
        new ASN1Null());
      cAlg_ = new AlgorithmIdentifier(new ASN1ObjectIdentifier(c),
        new ASN1Null());
  } catch (ASN1Exception e) {
      throw new InconsistentStateException(e);
  }
  /* Digest Algorithm Identifier */
  add(dAlg_);

  /* Authenticated Attributes */
 
View Full Code Here

      dAlg_ = new AlgorithmIdentifier(new ASN1ObjectIdentifier(d),
        new ASN1Null());
      cAlg_ = new AlgorithmIdentifier(new ASN1ObjectIdentifier(c),
        new ASN1Null());
  } catch (ASN1Exception e) {
      throw new InconsistentStateException(e);
  }
  /* Digest Algorithm Identifier */
  add(dAlg_);

  /* Authenticated Attributes */
 
View Full Code Here

    sig.update(bos.toByteArray());

    enc.close();
      } catch (ASN1Exception e) {
    throw new InconsistentStateException(e);
      } catch (IOException e) {
    throw new InconsistentStateException(e);
      } finally {
    /*
     * No matter what happens, in order to maintain the consistency
     * of the internal structure we have to set the tagging of the
     * authenticated attributes back to IMPLICIT.
View Full Code Here

      alg = algorithm_.getAlgorithmOID().toString();
      kf = KeyFactory.getInstance(alg);

      return kf.generatePublic(spec);
  } catch (ASN1Exception e) {
      throw new InconsistentStateException("Internal, encoding error!");
  } catch (IOException e) {
      throw new InconsistentStateException(
        "Internal, I/O exception caught!");
  } catch (InvalidKeySpecException e) {
      throw new InconsistentStateException(
        "Encoded key spec rejected by key factory!");
  }
    }
View Full Code Here

TOP

Related Classes of codec.InconsistentStateException

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.