pki

PHP RSA key creation

瘦欲@ 提交于 2019-12-01 17:55:23
I have an issue with creating/using RSA keys created and used in PHP. Problem is, that the (public AND private) keys should be exchanged between different servers (e.g. when a user account is moved). Now, the openssl-lib of PHP does not provide any detailed info on in what format the keys are created. The latest documentation at http://php.net/manual/en/function.openssl-pkey-export.php just states, that it is "in PEM format", but it does not say whether it is in PKCS#1 or PKCS#8 Additionally, the headers and trailers of the private key PEM differ between PHP versions as the following code

十三,k8s集群web端管理工具dashboard部署

别等时光非礼了梦想. 提交于 2019-12-01 17:34:08
目录 部署 dashboard 由于会被墙, 所以要加一步拉取镜像 正式开始安装dashboard 查看 开放访问 配置dashboard用户 1. token 令牌认证 创建一个 serviceAccount dashboard-admin 绑定 clusterbinding 的 sa 获取 serviceaccount 的 dashboard-admin 的secret信息 2. kubeconfig 文件认证 创建一个 serviceAccount 创建 rolebinding 绑定 def-ns-admin 创建集群和创建kubeconfig配置文件 拿到 def-ns-admin 用户的base64格式的token 设置 set-credentials 保存至 def-ns-admin.conf 配置 def-ns-admin.conf 上下文 配置当前上下文 测试使用kubeconfig文件登陆 基于 tls 验证 创建 dashboard 专用的 tls 证书 生成dashboard 用户的私钥 生成证书签署请求 给dashboard证书签证 创建 dashboard 对应的 secret Dashboard部署总结: 部署 dashboard 官方文档地址 由于会被墙, 所以要加一步拉取镜像 docker pull registry.cn-hangzhou

十一,k8s集群访问控制之ServicAccount

拥有回忆 提交于 2019-12-01 12:06:24
目录 认证安全 连接Api-Server的两类账号 ServiceAccount 创建 使用admin 的SA 测试 URL访问kubernetes资源 APIserver客户端定义的配置文件 kubernetes 集群相关的私有CA证书 创建新的apiserver的账号及证书 新创建私钥 验证查看生成的证书 设定用户账号 给jerry用户加入上下文 切换至刚刚增加的jerry用户的对应的 测试jerry用户权限 保存配置文件 认证安全 任何用途操作集群的资源对象是,都要经历三种安全相关的操作: 任何用户来访问时, 都需要完成kubernetes系统认证操作 认证通过后, 进行授权检查 准入控制, 检查是否有权限操作其它的一些资源操作 认证方式: 令牌认证:token SSL 秘钥认证:也是最常用的方式,能确认服务器身份 RBAC :全称 Role Base AccessControl ,用于授权操作 访问认证流程 客户端 访问 API Server是常用的参数. user: username, uid group: extra: API Request path: http://172.27.1.241:8888/apis/apps/v1/namespaces/default/deployments/myapp-deploy/ #

加密类型、数据加密解密过程以及CA创建

岁酱吖の 提交于 2019-12-01 10:25:01
对称加密算法 1 对称加密:加密和解密使用同一个密钥 2 DES:Data Encryption Standard,56bits 3 3DES: 4 AES:Advanced (128, 192, 256bits) 5 Blowfish,Twofish 6 IDEA,RC6,CAST5 7 特性: 8 1、加密、解密使用同一个密钥,效率高 9 2、将原始数据分割成固定大小的块,逐个进行加密 10 缺陷: 11 1、密钥过多 12 2、密钥分发 13 3、数据来源无法确认 非对称加密算法 1 公钥加密:密钥是成对出现 2 公钥:公开给所有人;public key 3 私钥:自己留存,必须保证其私密性;secret key 4 特点:用公钥加密数据,只能使用与之配对的私钥解密;反之亦然 5 功能: 6 数字签名:主要在于让接收方确认发送方身份 7 对称密钥交换:发送方用对方的公钥加密一个对称密钥后发送给对方 8 数据加密:适合加密较小数据 9 缺点:密钥长,加密解密效率低下 10 算法: 11 RSA(加密,数字签名) 12 DSA(数字签名) 13 ELGamal 单向散列(hash算法) 1 将任意数据缩小成固定大小的“指纹” 2 任意长度输入 3 固定长度输出 4 若修改数据,指纹也会改变(“不会产生冲突”) 5 无法从指纹中重新生成数据(“单向”) 6 功能:数据完整性 7

M2Crypto RSA.sign vs OpenSSL rsautl -sign

只愿长相守 提交于 2019-12-01 08:58:48
问题 M2Crypto and OpenSSL CLI doesn't seem to create the same digital signature. Here is the code that I use in Python: import M2Crypto rsa = M2Crypto.RSA.load_key("privkey.pem") open("sig_m2crypto", "w").write(rsa.sign("md5-digest", "md5")) Here is the command line with OpenSSL: echo "md5-digest" | openssl rsautl -sign -inkey privkey.pem > sig_openssl With the same input, the result of sig_m2crypto and sig_openssl are always different. The significance would be I can not verify signatures

ca认证、PXE自动化安装、自制u盘镜像并安装

狂风中的少年 提交于 2019-12-01 08:58:32
https://blog.51cto.com/13157015/1966084 PXE自动化安装 https://www.cnblogs.com/ance/p/10265962.html#i4 自制u盘镜像并安装 证书签名过程:1、网页服务器生成证书请求文件;2、认证中心确认申请者的身份真实性;3、认证中心使用根证书的私钥加密证书请求文件,生成证书;4、把证书传给申请者。 一、实验环境 node1  192.168.40.132  CA认证中心( 也要给自己颁发根证书 ) node2  192.168.40.211  网页服务器 由于没有真实域名,所以自己搭建一个CA认证中心,实际只要去申请一个就好了。 [root@node1 ~]# rpm -qf `which openssl` openssl-1.0.2k-8.el7.x86_64 //openssl一般默认安装的 [root@node1 ~]# vim /etc/pki/tls/openssl.cnf basicConstraints=CA: TRUE    //第172行,让当前服务器成为CA认证中心 [root@node1 ~]# /etc/pki/tls/misc/CA -newca   //新的CAche证书 CA certificate filename (or enter to create) //证书文件名

Error installing PKI package in R

笑着哭i 提交于 2019-12-01 07:44:15
I'd like to publish a slidify presentation in RPubs but it requires PKI and rsconnect packages. I'm having this error message when trying to install PKI package in R Installing package into ‘/home/juanchi/R/x86_64-pc-linux-gnu-library/3.2’ (as ‘lib’ is unspecified) probando la URL 'http://cran.rstudio.com/src/contrib/PKI_0.1-1.tar.gz' Content type 'application/x-gzip' length 20334 bytes (19 KB) ================================================== downloaded 19 KB * installing *source* package ‘PKI’ ... ** package ‘PKI’ successfully unpacked and MD5 sums checked ** libs gcc -std=gnu99 -I/usr

git verify trusted tags

爷,独闯天下 提交于 2019-12-01 07:41:45
I would like to include git tag -v command into the deployment process to catch unsigned tags or tags signed by a non-trusted GPG key. The command returns with an exit code of 0 if the tag has a valid signature, but does not care wether the signed key is trusted or not. I don't want to resort to grepping the resulting GPG message manually I haven't tried it yet, and the documentation doesn't mention exit codes, but you could try git-verify-tag plumbing command Update Having no easy way to test this, I've reviewed the source code: https://github.com/git/git/blob

encode() with private key in “AndroidKeyStore” return null

做~自己de王妃 提交于 2019-12-01 06:16:38
With Android 4.3, this code return null. KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore"); keyStore.load(null); keyStore.setKeyEntry(alias, privateKey, null, certificateChain); PrivateKeyEntry entry=(PrivateKeyEntry)keyStore.getEntry(alias, new PasswordProtection(password)); assert(entry.getPrivateKey().getEncoded()!=null); How it's possible to get the encoded version of private key ? Or, is it possible to transmit the private key handler to another application ? Thank's The Android KeyChain API prevents you from being able to get an encoded private key. See the method at line 158

Error installing PKI package in R

删除回忆录丶 提交于 2019-12-01 05:10:52
问题 I'd like to publish a slidify presentation in RPubs but it requires PKI and rsconnect packages. I'm having this error message when trying to install PKI package in R Installing package into ‘/home/juanchi/R/x86_64-pc-linux-gnu-library/3.2’ (as ‘lib’ is unspecified) probando la URL 'http://cran.rstudio.com/src/contrib/PKI_0.1-1.tar.gz' Content type 'application/x-gzip' length 20334 bytes (19 KB) ================================================== downloaded 19 KB * installing *source* package