当前位置: 首页>>代码示例>>Java>>正文


Java Configuration.DEBUG属性代码示例

本文整理汇总了Java中gnu.classpath.Configuration.DEBUG属性的典型用法代码示例。如果您正苦于以下问题:Java Configuration.DEBUG属性的具体用法?Java Configuration.DEBUG怎么用?Java Configuration.DEBUG使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在gnu.classpath.Configuration的用法示例。


在下文中一共展示了Configuration.DEBUG属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initializeLibrary

/**
 * @return <code>true</code> if the GMP-based native implementation library
 *         was successfully loaded. Returns <code>false</code> otherwise.
 */
private static boolean initializeLibrary()
{
  boolean result;
  try
  {
    System.loadLibrary("javamath");
    GMP.natInitializeLibrary();
    result = true;
  }
  catch (Throwable x)
  {
    result = false;
    if (Configuration.DEBUG)
      {
        log.info("Unable to use native BigInteger: " + x);
        log.info("Will use a pure Java implementation instead");
      }
  }
  return result;
}
 
开发者ID:vilie,项目名称:javify,代码行数:24,代码来源:BigInteger.java

示例2: setup

void setup() throws Exception
{
  setKeyStoreParams(_providerClassName, _ksType, _ksPassword, _ksURL);
  setAliasParam(_alias);
  setKeyPasswordNoPrompt(_password);
  setValidityParam(_validityStr);
  if (Configuration.DEBUG)
    {
      log.fine("-selfcert handler will use the following options:"); //$NON-NLS-1$
      log.fine("  -alias=" + alias); //$NON-NLS-1$
      log.fine("  -sigalg=" + _sigAlgorithm); //$NON-NLS-1$
      log.fine("  -dname=" + _dName); //$NON-NLS-1$
      log.fine("  -validity=" + validityInDays); //$NON-NLS-1$
      log.fine("  -storetype=" + storeType); //$NON-NLS-1$
      log.fine("  -keystore=" + storeURL); //$NON-NLS-1$
      log.fine("  -provider=" + provider); //$NON-NLS-1$
      log.fine("  -v=" + verbose); //$NON-NLS-1$
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:SelfCertCmd.java

示例3: start

void start() throws KeyStoreException, NoSuchAlgorithmException, IOException,
    UnsupportedCallbackException, UnrecoverableKeyException,
    CertificateException
{
  if (Configuration.DEBUG)
    log.entering(this.getClass().getName(), "start"); //$NON-NLS-1$
  // 1. get the key entry and certificate chain associated to alias
  Key privateKey = getAliasPrivateKey();
  Certificate[] chain = store.getCertificateChain(alias);

  // 2. replace the old entry
  setNewKeyPassword(_newPassword);
  store.setKeyEntry(alias, privateKey, newPasswordChars, chain);

  // 3. persist the key store
  saveKeyStore();
  if (Configuration.DEBUG)
    log.exiting(this.getClass().getName(), "start"); //$NON-NLS-1$
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:KeyPasswdCmd.java

示例4: start

void start() throws KeyStoreException, NoSuchAlgorithmException, IOException,
    UnsupportedCallbackException, UnrecoverableKeyException,
    CertificateException
{
  if (Configuration.DEBUG)
    log.entering(this.getClass().getName(), "start"); //$NON-NLS-1$
  if (store.containsAlias(destinationAlias))
    throw new SecurityException(Messages.getString("KeyCloneCmd.23")); //$NON-NLS-1$

  Key privateKey = getAliasPrivateKey();

  setNewKeyPassword(_newPassword);
  Certificate[] chain = store.getCertificateChain(alias);

  store.setKeyEntry(destinationAlias, privateKey, newKeyPasswordChars, chain);

  saveKeyStore();
  if (Configuration.DEBUG)
    log.exiting(this.getClass().getName(), "start"); //$NON-NLS-1$
}
 
开发者ID:vilie,项目名称:javify,代码行数:20,代码来源:KeyCloneCmd.java

示例5: finishSigning

/**
 * @param sectionsOnly whether to compute, in addition to the files, the hash
 * of the mainfest itself (<code>false</code>) or not (<code>true</code>).
 */
void finishSigning(boolean sectionsOnly) throws IOException
{
  if (state != STARTED)
    throw new IllegalStateException(Messages.getString("SFHelper.10")); //$NON-NLS-1$

  if (sectionsOnly)
    return;

  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  manifest.write(baos);
  baos.flush();
  String manifestHash = util.hashByteArray(baos.toByteArray());
  if (Configuration.DEBUG)
    log.fine("Hashed Manifest " + manifestHash); //$NON-NLS-1$
  sfMainAttributes.putValue(Main.DIGEST_MANIFEST, manifestHash);

  this.state = FINISHED;
}
 
开发者ID:vilie,项目名称:javify,代码行数:22,代码来源:SFHelper.java

示例6: setup

void setup() throws Exception
{
  setKeyStoreParams(_providerClassName, _ksType, _ksPassword, _ksURL);
  setAliasParam(_alias);
  setKeyPasswordNoPrompt(_password);
  if (Configuration.DEBUG)
    {
      log.fine("-keypasswd handler will use the following options:"); //$NON-NLS-1$
      log.fine("  -alias=" + alias); //$NON-NLS-1$
      log.fine("  -new=" + _newPassword); //$NON-NLS-1$
      log.fine("  -storetype=" + storeType); //$NON-NLS-1$
      log.fine("  -keystore=" + storeURL); //$NON-NLS-1$
      log.fine("  -provider=" + provider); //$NON-NLS-1$
      log.fine("  -v=" + verbose); //$NON-NLS-1$
    }
}
 
开发者ID:vilie,项目名称:javify,代码行数:16,代码来源:KeyPasswdCmd.java

示例7: importCertificate

/**
 * If the reply is a single X.509 certificate, keytool attempts to establish a
 * trust chain, starting at the certificate reply and ending at a self-signed
 * certificate (belonging to a root CA). The certificate reply and the
 * hierarchy of certificates used to authenticate the certificate reply form
 * the new certificate chain of alias. If a trust chain cannot be established,
 * the certificate reply is not imported. In this case, keytool does not print
 * out the certificate, nor does it prompt the user to verify it. This is
 * because it is very hard (if not impossible) for a user to determine the
 * authenticity of the certificate reply.
 *
 * @param certificate the certificate reply to import into the key store.
 * @throws NoSuchAlgorithmException
 * @throws CertPathValidatorException
 * @throws UnsupportedCallbackException
 * @throws IOException
 * @throws UnrecoverableKeyException
 * @throws KeyStoreException
 * @throws CertificateException
 */
private void importCertificate(Certificate certificate)
    throws NoSuchAlgorithmException, CertPathValidatorException,
    KeyStoreException, UnrecoverableKeyException, IOException,
    UnsupportedCallbackException, CertificateException
{
  if (Configuration.DEBUG)
    log.entering(this.getClass().getName(), "importCertificate", certificate); //$NON-NLS-1$
  LinkedList reply = new LinkedList();
  reply.addLast(certificate);

  if (! findTrustAndUpdate(reply, false))
    throw new CertPathValidatorException(Messages.getString("ImportCmd.34")); //$NON-NLS-1$

  Certificate[] newChain = (Certificate[]) reply.toArray(new Certificate[0]);
  Key privateKey = getAliasPrivateKey();
  store.setKeyEntry(alias, privateKey, keyPasswordChars, newChain);
  saveKeyStore();
  if (Configuration.DEBUG)
    log.exiting(this.getClass().getName(), "importCertificate"); //$NON-NLS-1$
}
 
开发者ID:vilie,项目名称:javify,代码行数:40,代码来源:ImportCmd.java

示例8: hashStream

/**
 * @param stream the input stream to digest.
 * @return a base-64 representation of the resulting SHA-1 digest of the
 *         contents of the designated input stream.
 * @throws IOException if an I/O related exception occurs during the process.
 */
String hashStream(InputStream stream) throws IOException
{
  BufferedInputStream bis = new BufferedInputStream(stream, 4096);
  byte[] buffer = new byte[4096];
  int count = 0;
  int n;
  while ((n = bis.read(buffer)) != - 1)
    if (n > 0)
      {
        sha.update(buffer, 0, n);
        count += n;
      }
  byte[] hash = sha.digest();
  if (Configuration.DEBUG)
    log.finest("Hashed " + count + " byte(s)");
  String result = Base64.encode(hash);
  return result;
}
 
开发者ID:vilie,项目名称:javify,代码行数:24,代码来源:HashUtils.java

示例9: setup

void setup() throws Exception
{
  setOutputStreamParam(null); // use stdout
  setKeyStoreParams(_providerClassName, _ksType, _ksPassword, _ksURL);
  all = _alias == null;
  if (! all)
    setAliasParam(_alias);

  if (verbose & rfc)
    {
      if (Configuration.DEBUG)
        log.fine("Both -v and -rfc options were found on the command line. " //$NON-NLS-1$
                 + "Only the former will be considered"); //$NON-NLS-1$
      rfc = false;
    }
  if (Configuration.DEBUG)
    {
      log.fine("-list handler will use the following options:"); //$NON-NLS-1$
      log.fine("  -alias=" + alias); //$NON-NLS-1$
      log.fine("  -storetype=" + storeType); //$NON-NLS-1$
      log.fine("  -keystore=" + storeURL); //$NON-NLS-1$
      log.fine("  -provider=" + provider); //$NON-NLS-1$
      log.fine("  -v=" + verbose); //$NON-NLS-1$
      log.fine("  -rfc=" + rfc); //$NON-NLS-1$
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:26,代码来源:ListCmd.java

示例10: saveKeyStore

/**
 * Saves the key store using the designated password. This operation is called
 * by handlers if/when the key store password has changed, or amendements have
 * been made to the contents of the store; e.g. addition of a new Key Entry or
 * a Trusted Certificate.
 * 
 * @param password the password protecting the key store.
 * @throws IOException if an I/O related exception occurs during the process.
 * @throws CertificateException if any of the certificates in the current key
 *           store could not be persisted.
 * @throws NoSuchAlgorithmException if a required data integrity algorithm
 *           implementation was not found.
 * @throws KeyStoreException if the key store has not been loaded previously.
 */
protected void saveKeyStore(char[] password) throws IOException,
    KeyStoreException, NoSuchAlgorithmException, CertificateException
{
  if (Configuration.DEBUG)
    log.entering(this.getClass().getName(), "saveKeyStore"); //$NON-NLS-1$
  URLConnection con = storeURL.openConnection();
  con.setDoOutput(true);
  con.setUseCaches(false);
  OutputStream out = con.getOutputStream();
  if (verbose)
    System.out.println(Messages.getFormattedString("Command.63", storeURL.getPath())); //$NON-NLS-1$

  store.store(out, password);
  out.flush();
  out.close();
  if (Configuration.DEBUG)
    log.exiting(this.getClass().getName(), "saveKeyStore"); //$NON-NLS-1$
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:32,代码来源:Command.java

示例11: setup

void setup() throws Exception
{
  setInputStreamParam(_certFileName);
  setKeyStoreParams(true, _providerClassName, _ksType, _ksPassword, _ksURL);
  setAliasParam(_alias);
  setKeyPasswordNoPrompt(_password);
  if (Configuration.DEBUG)
    {
      log.fine("-import handler will use the following options:"); //$NON-NLS-1$
      log.fine("  -alias=" + alias); //$NON-NLS-1$
      log.fine("  -file=" + _certFileName); //$NON-NLS-1$
      log.fine("  -noprompt=" + noPrompt); //$NON-NLS-1$
      log.fine("  -trustcacerts=" + trustCACerts); //$NON-NLS-1$
      log.fine("  -storetype=" + storeType); //$NON-NLS-1$
      log.fine("  -keystore=" + storeURL); //$NON-NLS-1$
      log.fine("  -provider=" + provider); //$NON-NLS-1$
      log.fine("  -v=" + verbose); //$NON-NLS-1$
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:19,代码来源:ImportCmd.java

示例12: setProviderClassNameParam

/**
 * Set a security provider class name to (install and) use for key store
 * related operations.
 * 
 * @param className the possibly null, fully qualified class name of a
 *          security provider to add, if it is not already installed, to the
 *          set of available providers.
 */
private void setProviderClassNameParam(String className)
{
  if (Configuration.DEBUG)
    log.fine("setProviderClassNameParam(" + className + ")"); //$NON-NLS-1$ //$NON-NLS-2$
  if (className != null && className.trim().length() > 0)
    {
      className = className.trim();
      SecurityProviderInfo spi = ProviderUtil.addProvider(className);
      provider = spi.getProvider();
      if (provider == null)
        {
          if (Configuration.DEBUG)
            log.fine("Was unable to add provider from class " + className);
        }
      providerNdx = spi.getPosition();
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:25,代码来源:Command.java

示例13: setup

void setup() throws Exception
{
  setOutputStreamParam(_certReqFileName);
  setKeyStoreParams(_providerClassName, _ksType, _ksPassword, _ksURL);
  setAliasParam(_alias);
  setKeyPasswordNoPrompt(_password);
  if (Configuration.DEBUG)
    {
      log.fine("-certreq handler will use the following options:"); //$NON-NLS-1$
      log.fine("  -alias=" + alias); //$NON-NLS-1$
      log.fine("  -sigalg=" + _sigAlgorithm); //$NON-NLS-1$
      log.fine("  -file=" + _certReqFileName); //$NON-NLS-1$
      log.fine("  -storetype=" + storeType); //$NON-NLS-1$
      log.fine("  -keystore=" + storeURL); //$NON-NLS-1$
      log.fine("  -provider=" + provider); //$NON-NLS-1$
      log.fine("  -v=" + verbose); //$NON-NLS-1$
      log.fine("  -attributes=" + nullAttributes); //$NON-NLS-1$
    }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:19,代码来源:CertReqCmd.java

示例14: start

/**
 * Invokes the <code>start()</code> method of the concrete handler.
 * <p>
 * Depending on the result of processing the command line arguments, this
 * handler may be one for signing the jar, or verifying it.
 * 
 * @throws Exception if an exception occurs during the process.
 */
private void start() throws Exception
{
  if (Configuration.DEBUG)
    log.entering(this.getClass().getName(), "start"); //$NON-NLS-1$
  if (verify)
    {
      JarVerifier jv = new JarVerifier(this);
      jv.start();
    }
  else
    {
      JarSigner js = new JarSigner(this);
      js.start();
    }
  if (Configuration.DEBUG)
    log.exiting(this.getClass().getName(), "start"); //$NON-NLS-1$
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:25,代码来源:Main.java

示例15: getSubjectName

/**
 * Given an X.509 certificate this method returns the string representation of
 * the Subject Distinguished Name.
 * 
 * @param cert an X.509 certificate.
 * @return the string representation of the Subject's DN.
 */
private String getSubjectName(X509Certificate cert)
{
  X500Principal xp = cert.getSubjectX500Principal();
  if (xp == null)
    {
      if (Configuration.DEBUG)
        log.fine("Certiticate, with serial number " + cert.getSerialNumber() //$NON-NLS-1$
                 + ", has null Subject. Return [unknown]"); //$NON-NLS-1$
      return Messages.getString("SFHelper.14"); //$NON-NLS-1$
    }
  String result = xp.getName();
  if (result == null)
    {
      if (Configuration.DEBUG)
        log.fine("Certiticate, with serial number " + cert.getSerialNumber() //$NON-NLS-1$
                 + ", has a Subject with null DN. Return [unnamed]"); //$NON-NLS-1$
      return Messages.getString("SFHelper.17"); //$NON-NLS-1$
    }
  return result;
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:27,代码来源:SFHelper.java


注:本文中的gnu.classpath.Configuration.DEBUG属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。