openssl 签名和验证签名 举例

最近有不少人问我如何用openssl命令行来进行签名,验证签名,以及其它一些openssl的命令。 其实我对openssl也不太了解,倒是对rsa了解得比较多一些,像rsa背后的欧拉公式以及证明啊什么的,呵呵呵。 写一个小脚本,里面包含了加密/解密,签名/验证签名等一些例子,仅供参考。 [shell] #!/bin/bash set -e set -x # Generate 1024 bits rsa private key and output to file "test.key". # This private key was encrypted by AES256 with the password "hukeping". openssl genrsa -aes256 -passout pass:hukeping  -out test.key 1024 # Generate public key from the private key file "test.key" and output it to… Continue reading openssl 签名和验证签名 举例

Published
Categorized as Study

godef: tag stack empty

Recently I configure my mac with vim-go and gotags which could jump to a tag definition with the CTRL-]  and jump back with CTRL-t . But when I jump back , I end up with an error “godef stack empty” , fortunately you could fix this by add the follow line to your  ~/.vimrc let g:go_def_mapping_enabled=0

Published
Categorized as golang, Study

Be a maintainer

Thanks, all of you!   https://github.com/docker/notary/pull/934

Published
Categorized as golang, ilife

Fail when go get gopkg.in/yaml.v2

One may comes across some error on install yaml.v2 using `go get`, like: $ go get gopkg.in/yaml.v2 package gopkg.in/yaml.v2: unrecognized import path “gopkg.in/yaml.v2” Usually it’s a network error, please try: $ go get -v gopkg.in/yaml.v2 Fetching https://gopkg.in/yaml.v2?go-get=1 https fetch failed. import “gopkg.in/yaml.v2”: https fetch: Get https://gopkg.in/yaml.v2?go-get=1: x509: certificate signed by unknown authority package gopkg.in/yaml.v2: unrecognized… Continue reading Fail when go get gopkg.in/yaml.v2

Published
Categorized as golang, Study

Tips for cron

Hi there, We all know that if one wants to schedule jobs (commands or shell scripts) to run periodically at certain times or dates, he can use `cron`. If you `man cron` you would like to get: Cron – daemon to execute scheduled commands. And here are some tips for newcomes: 1. Use absolute path… Continue reading Tips for cron

Published
Categorized as Study, Ubuntu

A special commit message

commit 01a2ffca9aa958c9093f5419aec59b98d9dff3ab Author: HuKeping <hukeping@huawei.com> Date: Mon Nov 23 18:41:21 2015 +0800 Remove test user Say goodbye to tester0~tester99999, we appreciate what you’ve done. Signed-off-by: Hu Keping <hukeping@huawei.com> diff –git a/user/user.go b/user/user.go

Published
Categorized as Study