sign

WCF over HTTPS and Signing the body

前提是你 提交于 2019-12-03 08:01:18
I've got a SOAP service I want to connect to. It needs to be accessed trough https and it needs to have it's body signed by a certificate. I've tried the following code: <basicHttpBinding> <binding name="P4Binding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32

Google Sign in API - get photo Uri is null

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I was using Google Sign in API to request user profile, likes user display name, avatar photo. I got null value GoogleSignInAccount.getPhotoUrl(), got value GoogleSignInAccount.getDisplayName(). Gmail account ok, but private account is not. private account is linked to Google gmail, it can see the picture in my Gmail account and Google Play store app, Google plus too. but why I got null value with using Google Sign In account API. GoogleSignInOptions.Builder builder = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)

Bouncycastle PGP decrypt and verify

女生的网名这么多〃 提交于 2019-12-03 07:33:27
I'm trying to decrypt and verify a PGP message using the java BouncyCastle libraries, but am running into issues, complaining about premature ends of PartialInputStream. I know the encrypt works fine, because I can decrypt and verify messages created with the encrypt function using gpg on the command line. Here's the code: public static void signEncryptMessage(InputStream in, OutputStream out, PGPPublicKey publicKey, PGPPrivateKey secretKey, SecureRandom rand) throws Exception { out = new ArmoredOutputStream(out); PGPEncryptedDataGenerator encryptedDataGenerator = new PGPEncryptedDataGenerator

RSA前台加密后台解密的应用

扶醉桌前 提交于 2019-12-03 07:25:36
写在前面 安全测试需要, 为防止后台响应数据返给前台过程中被篡改前台再拿被篡改后的数据进行接下来的操作影响正常业务, 决定采用RSA对响应数据进行签名和验签, 于是有了这篇<RSA后台签名前台验签的应用>. 我这里所谓的返给前台的数据只是想加密用户验证通过与否的字段success是true还是false, 前台拿这个success作为判断依据进行下一步的操作, 是进一步向后台发起请求还是直接弹出错误消息.照测试结果看这是个逻辑漏洞, 即使后台返回的是false, 在返回前台的过程中响应包被劫获, 将false改为true, 这样的操作也是能做到的(BurpSuit). 所以后台响应数据尽量不要再二次使用. 那既然能篡改, 如何防止流氓篡改呢? 说一下整体思路: 首先生成密钥对, 私钥存放在后台用于签名, 公钥存放在前台用于验签. 所谓签名就是指拿明文+私钥生成的 签名结果 , 返回数据给前台时将 明文+签名结果 一并返给前台, 前台用 公钥+接收到的明文+签名结果 进行验签, 这样即使响应包被劫获, 篡改明文后, 验证签名时也不会验证通过, 从而达到响应数据防篡改的目的. 接下来说一下具体步骤. 正文(具体步骤) 1.在线生成密钥对 采用在线工具生成密钥对, 私钥密码可填可不填, 网址: http://web.chacuo.net/netrsakeypair 生成密钥对备用. 2

Resign apk with different keystore

蹲街弑〆低调 提交于 2019-12-03 06:30:51
问题 Currently I'm getting the apk signed with the private keystore file but I want to sign that apk with different keystore file. How can I resign that apk..? 回答1: you should check below SO thread Can I resign an .apk with a different certificate or this one also may help you 回答2: You can resign your apk with different keystore. Follow these steps: Signing for release: $1.apk -> $1_release.apk" Step 1: Removing any previous signing Change the extension of your .apk to .zip . Open and delete the

CSS

有些话、适合烂在心里 提交于 2019-12-03 04:25:20
CSS部分也只是添加一些自己不太熟悉的部分。 1.派生选择器 比如你想要p标签里面的a标签(无论嵌套有多深)没有下划线而不是全局的a标签没有下划线,你可以这样写 p a{   text-decoration:none; } 如果写作p>a则只能p直接下面的a标签。 当然这只是一个简单的例子,可以自定义其他显示的规则。 另外可以通过id来建立派生选择器,例:footer 里面的链接没有下划线 #footer a{   text-decoration:none; } ps : 也可以通过id单独设置样式 2.类选择器 .sign p{ color:red; } 这句话的意思是类名为sign里面的p标签文字都是红色的。例: <div class="sign"> <p>红色</p> </div> p .sign{ color:red; } 这句话的意思是那些类名为sign的p标签文字是红色的。 例 <div class="sign"> <p class="sign"> 红色 </p> <p>不是红色</p> </div> 3.属性选择器 为带有某个属性的标签设置样式 [title] { color:red; } 还可以指定 [title="flag"] { color:red;} 但是我觉得这个最主要的作用还是这个例子 input[type="text"] { width:150px;

LeetCode 764. Largest Plus Sign

百般思念 提交于 2019-12-03 04:09:19
原题链接在这里: https://leetcode.com/problems/largest-plus-sign/ 题目: In a 2D grid from (0, 0) to (N-1, N-1), every cell contains a 1 , except those cells in the given list mines which are 0 . What is the largest axis-aligned plus sign of 1 s contained in the grid? Return the order of the plus sign. If there is none, return 0. An " axis-aligned plus sign of 1 s of order k" has some center grid[x][y] = 1 along with 4 arms of length k-1 going up, down, left, and right, and made of 1 s. This is demonstrated in the diagrams below. Note that there could be 0 s or 1 s beyond the arms of the plus sign, only

Changing the sign of a number in PHP?

為{幸葍}努か 提交于 2019-12-03 04:02:32
问题 I have a few floats: -4.50 +6.25 -8.00 -1.75 How can I change all these to negative floats so they become: -4.50 -6.25 -8.00 -1.75 Also I need a way to do the reverse If the float is a negative, make it a positive. 回答1: A trivial $num = $num <= 0 ? $num : -$num ; or, the better solution, IMHO: $num = -1 * abs($num) As @VegardLarsen has posted, the explicit multiplication can be avoided for shortness but I prefer readability over shortness I suggest to avoid if/else (or equivalent ternary

How to see what attributes are signed inside pkcs#7?

最后都变了- 提交于 2019-12-03 03:39:56
I have a pkcs#7 file, which contains signed data. It successfully verifies: $ openssl smime -verify -in data.p7s -CAfile root-certificate.pem Verification successful Signed data But when I extract the signed part, I do not see that it is actually the same as what was signed. I mean the following steps: $ openssl asn1parse -in data.p7s ... 35:d=4 hl=2 l= 9 prim: OBJECT :pkcs7-data 46:d=4 hl=2 l=inf cons: cont [ 0 ] 48:d=5 hl=2 l=inf cons: OCTET STRING 50:d=6 hl=2 l= 5 prim: OCTET STRING :(my data is here in plaintext) ... (then the signed block starts:) 2861:d=6 hl=2 l= 9 prim: OBJECT

openSSL sign https_client certificate with CA

匿名 (未验证) 提交于 2019-12-03 03:10:03
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to: create a CA certificate create a https_client-certificate sign the https_client-certificate by the CA by using the command-line on Linux - openSUSE. I create the CA certificate: # openssl genrsa -out rootCA.key 2048 Generating RSA private key, 2048 bit long modulus ..........................................................+++ ....................+++ e is 65537 (0x10001) # openssl req -x509 -new -nodes -key rootCA.key -days 3650 -out rootCA.pem You are about to be asked to enter information that will be incorporated into your