pki 证书验证机制_网络身份验证的PKI签名请求和证书颁发

pki 证书验证机制In a PKI (Public Key Infrastructure) system, proof of identity and ownership of key pairs must be verified before the issuance of a digital certificate (X.509) using asymmetric cryptography....
摘要由CSDN通过智能技术生成

pki 证书验证机制

In a PKI (Public Key Infrastructure) system, proof of identity and ownership of key pairs must be verified before the issuance of a digital certificate (X.509) using asymmetric cryptography. A request is sent by an applicant to a CA (Certificate Authority) in order to obtain a digital certificate. Once the identity has been authenticated by a CA, the applicant is issued a digital certificate. This also authorizes the applicant as a member of the network or ecosystem. This gives members the rights and privileges to transact, store and share data. The certificate acts as part of the member’s digital identity.

PKI(公共密钥基础结构)系统中,必须在使用非对称密码术颁发数字证书(X.509)之前验证密钥对的身份和所有权证明。 申请人将请求发送到CA(证书颁发机构)以获取数字证书。 一旦CA验证了身份,便会向申请人颁发数字证书。 这也授权申请人为网络或生态系统的成员。 这赋予成员交易,存储和共享数据的权利和特权。 证书是会员数字身份的一部分

A digital identity can represent an individual, organization, application or device through the issuance of a digital certificate. The digital certificate contains verified attributes of that representation, which proves the ownership of that identity. These attributes can also contain data that makes up Personally Identifiable Information (PII). The certificate issued by a CA provides authentication, authorization and trust for the digital identity. This provides a way to secure a system against non-members, so it is a trusted and permissioned system. The certificates must be valid for that particular system or else users will not be granted access to any of its resources.

数字身份可以通过颁发数字证书来代表个人,组织,应用程序或设备。 数字证书包含该表示形式的经过验证的属性,可证明该身份的所有权。 这些属性还可以包含构成个人身份信息(PII)的数据 。 由CA颁发的证书为数字身份提供身份验证,授权和信任。 这提供了一种保护系统免受非成员侵害的方法,因此它是一个受信任允许的系统。 证书必须对该特定系统有效,否则将不授予用户访问其任何资源的权限。

Image for post
In a PKI, a user applies for a digital certificate by first 1) sending a request CSR (Certificate Signing Request). The request is 2) sent to a CA (Certificate Authority) Server. The CA verifies the authenticity of the applicant, and if it is verified, the 3) CA
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
使用PKCS#10格式的证书请求申请PKI证书的一般步骤如下: 1. 生成PKCS#10格式的证书请求,可以使用Java的`sun.security.pkcs10.PKCS10`类完成,示例代码如下: ```java import java.io.IOException; import java.security.*; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import sun.security.pkcs10.PKCS10; import sun.security.x509.X500Name; public class PKCS10Generator { public static void main(String[] args) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException, CertificateException, IOException { KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA"); keyPairGen.initialize(2048); KeyPair keyPair = keyPairGen.generateKeyPair(); PrivateKey privateKey = keyPair.getPrivate(); PublicKey publicKey = keyPair.getPublic(); X500Name subject = new X500Name("CN=example.com,O=Example Inc.,L=San Francisco,ST=California,C=US"); PKCS10 pkcs10 = new PKCS10(publicKey); Signature signature = Signature.getInstance("SHA256withRSA"); signature.initSign(privateKey); pkcs10.encodeAndSign(subject, signature); byte[] p10 = pkcs10.getEncoded(); // 将p10保存到本地文件或发送到证书颁发机构(CA)进行签发 } } ``` 这个示例代码生成一个2048位的RSA密钥对,并使用`sun.security.pkcs10.PKCS10`类生成PKCS#10格式的证书请求,其中的`X500Name`类用于指定证书主题,签名算法使用的是`SHA256withRSA`。 2. 将生成的PKCS#10格式的证书请求发送到证书颁发机构(CA)进行签发。CA会验证证书请求的合法性,并为其签发PKI证书。一般情况下,CA会要求申请人提供一些证明身份的材料,例如身份证、营业执照等。 3. 在申请到PKI证书之后,使用Java的`java.security.KeyStore`类将证书导入到Keystore中,示例代码如下: ```java import java.io.FileInputStream; import java.security.KeyStore; import java.security.cert.Certificate; public class PKIImport { public static void main(String[] args) throws Exception { String keystoreFile = "/path/to/keystore.jks"; String keystorePassword = "password"; String alias = "alias"; String certFile = "/path/to/cert.cer"; FileInputStream is = new FileInputStream(certFile); CertificateFactory cf = CertificateFactory.getInstance("X.509"); Certificate cert = cf.generateCertificate(is); is.close(); KeyStore ks = KeyStore.getInstance("JKS"); ks.load(new FileInputStream(keystoreFile), keystorePassword.toCharArray()); ks.setCertificateEntry(alias, cert); ks.store(new FileOutputStream(keystoreFile), keystorePassword.toCharArray()); } } ``` 这个示例代码从指定路径的证书文件中读取PKI证书,然后将证书导入到指定路径的Keystore中。在实际应用中,Keystore一般会使用密码进行保护。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值