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


Java CertificateEncodingException.printStackTrace方法代码示例

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


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

示例1: getSigningKey

import java.security.cert.CertificateEncodingException; //导入方法依赖的package包/类
/**
 * Returns the private key signature on JBMR2+ or else null.
 */
public static String getSigningKey(String alias) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
        Certificate cert = getPrivateKeyEntry(alias).getCertificate();
        if (cert == null) {
            return null;
        }
        try {
            return Base64.encodeToString(cert.getEncoded(), Base64.NO_WRAP);
        } catch (CertificateEncodingException e) {
            e.printStackTrace();
            return null;
        }
    } else {
        return null;
    }
}
 
开发者ID:ronghao,项目名称:CacheManage,代码行数:20,代码来源:KeyStoreHelper.java

示例2: v

import java.security.cert.CertificateEncodingException; //导入方法依赖的package包/类
public static String v(Context context) {
    PackageInfo packageInfo;
    String str = null;
    try {
        packageInfo = context.getPackageManager().getPackageInfo(u(context), 64);
    } catch (NameNotFoundException e) {
        e.printStackTrace();
        Object obj = str;
    }
    InputStream byteArrayInputStream = new ByteArrayInputStream(packageInfo.signatures[0].toByteArray());
    try {
        CertificateFactory instance = CertificateFactory.getInstance("X509");
    } catch (CertificateException e2) {
        e2.printStackTrace();
        obj = str;
    }
    try {
        X509Certificate x509Certificate = (X509Certificate) instance.generateCertificate(byteArrayInputStream);
    } catch (CertificateException e22) {
        e22.printStackTrace();
        obj = str;
    }
    try {
        str = a(MessageDigest.getInstance(CommonUtils.MD5_INSTANCE).digest(x509Certificate.getEncoded()));
    } catch (NoSuchAlgorithmException e3) {
        e3.printStackTrace();
    } catch (CertificateEncodingException e4) {
        e4.printStackTrace();
    }
    return str;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:32,代码来源:bt.java

示例3: w

import java.security.cert.CertificateEncodingException; //导入方法依赖的package包/类
public static String w(Context context) {
    PackageInfo packageInfo;
    String str = null;
    try {
        packageInfo = context.getPackageManager().getPackageInfo(v(context), 64);
    } catch (NameNotFoundException e) {
        e.printStackTrace();
        Object obj = str;
    }
    InputStream byteArrayInputStream = new ByteArrayInputStream(packageInfo.signatures[0].toByteArray());
    try {
        CertificateFactory instance = CertificateFactory.getInstance("X509");
    } catch (CertificateException e2) {
        e2.printStackTrace();
        obj = str;
    }
    try {
        X509Certificate x509Certificate = (X509Certificate) instance.generateCertificate(byteArrayInputStream);
    } catch (CertificateException e22) {
        e22.printStackTrace();
        obj = str;
    }
    try {
        str = a(MessageDigest.getInstance(Coder.KEY_MD5).digest(x509Certificate.getEncoded()));
    } catch (NoSuchAlgorithmException e3) {
        e3.printStackTrace();
    } catch (CertificateEncodingException e4) {
        e4.printStackTrace();
    }
    return str;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:32,代码来源:bt.java


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