gpt4 book ai didi

org.apache.harmony.security.provider.cert.X509CertFactoryImpl.decodePEM()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 16:03:40 28 4
gpt4 key购买 nike

本文整理了Java中org.apache.harmony.security.provider.cert.X509CertFactoryImpl.decodePEM()方法的一些代码示例,展示了X509CertFactoryImpl.decodePEM()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。X509CertFactoryImpl.decodePEM()方法的具体详情如下:
包路径:org.apache.harmony.security.provider.cert.X509CertFactoryImpl
类名称:X509CertFactoryImpl
方法名:decodePEM

X509CertFactoryImpl.decodePEM介绍

[英]Method retrieves the PEM encoded data from the stream and returns its decoded representation. Method checks correctness of PEM boundaries. It supposes that the first '-' of the opening boundary has already been read from the stream. So first of all it checks that the leading bytes are equal to "-----BEGIN" boundary prefix. Than if boundary_suffix is not null, it checks that next bytes equal to boundary_suffix + new line char[s] ([CR]LF). If boundary_suffix parameter is null, method supposes free suffix format and skips any bytes until the new line.
After the opening boundary has been read and checked, the method read Base64 encoded data until closing PEM boundary is not reached.
Than it checks closing boundary - it should start with new line + "-----END" + boundary_suffix. If boundary_suffix is null, any characters are skipped until the new line.
After this any trailing new line characters are skipped from the stream, Base64 encoding is decoded and returned.
[中]方法从流中检索PEM编码的数据,并返回其解码的表示形式。方法检查PEM边界的正确性。它假设已经从流中读取了开放边界的第一个“-”。首先,它检查前导字节是否等于“----BEGIN”边界前缀。如果boundary_suffix不为null,它会检查下一个字节是否等于boundary_suffix+新行字符[s]([CR]LF)。如果boundary_suffix参数为null,则该方法假定为自由后缀格式,并跳过所有字节,直到新行出现。
读取并检查打开边界后,该方法读取Base64编码数据,直到未达到关闭PEM边界。
然后检查闭合边界-它应该以新行+“----结束”+边界后缀开头。如果boundary_suffix为空,则跳过所有字符,直到换行。
在此之后,从流中跳过任何尾随的新行字符,对Base64编码进行解码并返回。

代码示例

代码示例来源:origin: robovm/robovm

return getCertificate(decodePEM(inStream, CERT_BOUND_SUFFIX));
} else {
  inStream.reset();

代码示例来源:origin: robovm/robovm

decodePEM(inStream, FREE_BOUND_SUFFIX), encoding);
} else if (ch == 0x30) { // ASN.1 Sequence
  inStream.reset();

代码示例来源:origin: robovm/robovm

/**
 * @see java.security.cert.CertificateFactorySpi#engineGenerateCRL(InputStream)
 * method documentation for more info
 */
public CRL engineGenerateCRL(InputStream inStream)
    throws CRLException {
  if (inStream == null) {
    throw new CRLException("inStream == null");
  }
  try {
    if (!inStream.markSupported()) {
      // Create the mark supporting wrapper
      // Mark is needed to recognize the format
      // of provided encoding form (ASN.1 or PEM)
      inStream = new RestoringInputStream(inStream);
    }
    inStream.mark(1);
    // check whether the provided crl is in PEM encoded form
    if (inStream.read() == '-') {
      // decode PEM, retrieve CRL
      return getCRL(decodePEM(inStream, FREE_BOUND_SUFFIX));
    } else {
      inStream.reset();
      // retrieve CRL
      return getCRL(inStream);
    }
  } catch (IOException e) {
    throw new CRLException(e);
  }
}

代码示例来源:origin: robovm/robovm

encoding = decodePEM(inStream, FREE_BOUND_SUFFIX);
} else if (ch == 0x30) { // beginning of ASN.1 sequence (0x30)
  encoding = null;

代码示例来源:origin: robovm/robovm

encoding = decodePEM(inStream, FREE_BOUND_SUFFIX);
} else if (ch == 0x30) { // beginning of ASN.1 sequence (0x30)
  encoding = null;

代码示例来源:origin: MobiVM/robovm

decodePEM(inStream, FREE_BOUND_SUFFIX), encoding);
} else if (ch == 0x30) { // ASN.1 Sequence
  inStream.reset();

代码示例来源:origin: com.gluonhq/robovm-rt

decodePEM(inStream, FREE_BOUND_SUFFIX), encoding);
} else if (ch == 0x30) { // ASN.1 Sequence
  inStream.reset();

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

decodePEM(inStream, FREE_BOUND_SUFFIX), encoding);
} else if (ch == 0x30) { // ASN.1 Sequence
  inStream.reset();

代码示例来源:origin: FlexoVM/flexovm

decodePEM(inStream, FREE_BOUND_SUFFIX), encoding);
} else if (ch == 0x30) { // ASN.1 Sequence
  inStream.reset();

代码示例来源:origin: ibinti/bugvm

decodePEM(inStream, FREE_BOUND_SUFFIX), encoding);
} else if (ch == 0x30) { // ASN.1 Sequence
  inStream.reset();

代码示例来源:origin: com.bugvm/bugvm-rt

decodePEM(inStream, FREE_BOUND_SUFFIX), encoding);
} else if (ch == 0x30) { // ASN.1 Sequence
  inStream.reset();

代码示例来源:origin: com.gluonhq/robovm-rt

return getCertificate(decodePEM(inStream, CERT_BOUND_SUFFIX));
} else {
  inStream.reset();

代码示例来源:origin: com.bugvm/bugvm-rt

return getCertificate(decodePEM(inStream, CERT_BOUND_SUFFIX));
} else {
  inStream.reset();

代码示例来源:origin: MobiVM/robovm

return getCertificate(decodePEM(inStream, CERT_BOUND_SUFFIX));
} else {
  inStream.reset();

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

/**
 * @see java.security.cert.CertificateFactorySpi#engineGenerateCRL(InputStream)
 * method documentation for more info
 */
public CRL engineGenerateCRL(InputStream inStream)
    throws CRLException {
  if (inStream == null) {
    throw new CRLException("inStream == null");
  }
  try {
    if (!inStream.markSupported()) {
      // Create the mark supporting wrapper
      // Mark is needed to recognize the format
      // of provided encoding form (ASN.1 or PEM)
      inStream = new RestoringInputStream(inStream);
    }
    inStream.mark(1);
    // check whether the provided crl is in PEM encoded form
    if (inStream.read() == '-') {
      // decode PEM, retrieve CRL
      return getCRL(decodePEM(inStream, FREE_BOUND_SUFFIX));
    } else {
      inStream.reset();
      // retrieve CRL
      return getCRL(inStream);
    }
  } catch (IOException e) {
    throw new CRLException(e);
  }
}

代码示例来源:origin: FlexoVM/flexovm

/**
 * @see java.security.cert.CertificateFactorySpi#engineGenerateCRL(InputStream)
 * method documentation for more info
 */
public CRL engineGenerateCRL(InputStream inStream)
    throws CRLException {
  if (inStream == null) {
    throw new CRLException("inStream == null");
  }
  try {
    if (!inStream.markSupported()) {
      // Create the mark supporting wrapper
      // Mark is needed to recognize the format
      // of provided encoding form (ASN.1 or PEM)
      inStream = new RestoringInputStream(inStream);
    }
    inStream.mark(1);
    // check whether the provided crl is in PEM encoded form
    if (inStream.read() == '-') {
      // decode PEM, retrieve CRL
      return getCRL(decodePEM(inStream, FREE_BOUND_SUFFIX));
    } else {
      inStream.reset();
      // retrieve CRL
      return getCRL(inStream);
    }
  } catch (IOException e) {
    throw new CRLException(e);
  }
}

代码示例来源:origin: MobiVM/robovm

/**
 * @see java.security.cert.CertificateFactorySpi#engineGenerateCRL(InputStream)
 * method documentation for more info
 */
public CRL engineGenerateCRL(InputStream inStream)
    throws CRLException {
  if (inStream == null) {
    throw new CRLException("inStream == null");
  }
  try {
    if (!inStream.markSupported()) {
      // Create the mark supporting wrapper
      // Mark is needed to recognize the format
      // of provided encoding form (ASN.1 or PEM)
      inStream = new RestoringInputStream(inStream);
    }
    inStream.mark(1);
    // check whether the provided crl is in PEM encoded form
    if (inStream.read() == '-') {
      // decode PEM, retrieve CRL
      return getCRL(decodePEM(inStream, FREE_BOUND_SUFFIX));
    } else {
      inStream.reset();
      // retrieve CRL
      return getCRL(inStream);
    }
  } catch (IOException e) {
    throw new CRLException(e);
  }
}

代码示例来源:origin: com.gluonhq/robovm-rt

/**
 * @see java.security.cert.CertificateFactorySpi#engineGenerateCRL(InputStream)
 * method documentation for more info
 */
public CRL engineGenerateCRL(InputStream inStream)
    throws CRLException {
  if (inStream == null) {
    throw new CRLException("inStream == null");
  }
  try {
    if (!inStream.markSupported()) {
      // Create the mark supporting wrapper
      // Mark is needed to recognize the format
      // of provided encoding form (ASN.1 or PEM)
      inStream = new RestoringInputStream(inStream);
    }
    inStream.mark(1);
    // check whether the provided crl is in PEM encoded form
    if (inStream.read() == '-') {
      // decode PEM, retrieve CRL
      return getCRL(decodePEM(inStream, FREE_BOUND_SUFFIX));
    } else {
      inStream.reset();
      // retrieve CRL
      return getCRL(inStream);
    }
  } catch (IOException e) {
    throw new CRLException(e);
  }
}

代码示例来源:origin: ibinti/bugvm

/**
 * @see java.security.cert.CertificateFactorySpi#engineGenerateCRL(InputStream)
 * method documentation for more info
 */
public CRL engineGenerateCRL(InputStream inStream)
    throws CRLException {
  if (inStream == null) {
    throw new CRLException("inStream == null");
  }
  try {
    if (!inStream.markSupported()) {
      // Create the mark supporting wrapper
      // Mark is needed to recognize the format
      // of provided encoding form (ASN.1 or PEM)
      inStream = new RestoringInputStream(inStream);
    }
    inStream.mark(1);
    // check whether the provided crl is in PEM encoded form
    if (inStream.read() == '-') {
      // decode PEM, retrieve CRL
      return getCRL(decodePEM(inStream, FREE_BOUND_SUFFIX));
    } else {
      inStream.reset();
      // retrieve CRL
      return getCRL(inStream);
    }
  } catch (IOException e) {
    throw new CRLException(e);
  }
}

代码示例来源:origin: com.bugvm/bugvm-rt

/**
 * @see java.security.cert.CertificateFactorySpi#engineGenerateCRL(InputStream)
 * method documentation for more info
 */
public CRL engineGenerateCRL(InputStream inStream)
    throws CRLException {
  if (inStream == null) {
    throw new CRLException("inStream == null");
  }
  try {
    if (!inStream.markSupported()) {
      // Create the mark supporting wrapper
      // Mark is needed to recognize the format
      // of provided encoding form (ASN.1 or PEM)
      inStream = new RestoringInputStream(inStream);
    }
    inStream.mark(1);
    // check whether the provided crl is in PEM encoded form
    if (inStream.read() == '-') {
      // decode PEM, retrieve CRL
      return getCRL(decodePEM(inStream, FREE_BOUND_SUFFIX));
    } else {
      inStream.reset();
      // retrieve CRL
      return getCRL(inStream);
    }
  } catch (IOException e) {
    throw new CRLException(e);
  }
}

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com