sign

自定义View实现七天签到

纵饮孤独 提交于 2019-12-11 19:52:41
Android 自定义View实现七天签到 使用: /** * Created by user on 19/12/10. */ public class SignInViews extends View { private static final int DEF_HEIGHT = 85; private static final int DEF_PADDING = 10; private static final int TEXT_MARGIN_TOP = 13; private static final float SECTION_SCALE = 1.2F / 2; private static final float SIGN_IN_BALL_SCALE = 1F / 6; private static final float SIGN_BG_RECT_SCALE = 1F / 4; private static final long DEF_ANIM_TIME = 1000; private int signInBgColor; private int signInPbColor; private int signInCheckColor; private int singInTextColor; private int singInTextSize; private

Amazon S3 Securing Static Website

最后都变了- 提交于 2019-12-11 18:54:27
问题 I'm looking for a combination of policies to access a static website in a S3 bucket only with a certain token/sign string. I mean, is it possibile to make the static website not readable by everyone by default but temporary accessible with something like http://mybucket.s3-website-location.amazonaws.com/myfolder/index.html?sign=XXXXX ? With this call you should also have access to all the tree in the "myfolder" folder. 回答1: You can only do this for a single URL at a time, using a signed S3

Signing PDF with multiple signature fields using PDFBox 2.0.17

让人想犯罪 __ 提交于 2019-12-11 16:19:04
问题 I am trying to sign a PDF with 2 signature fields using the example code provided by PDFBox ( https://svn.apache.org/repos/asf/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateVisibleSignature.java ). But the signed PDF shows There have been changes made to this document that invalidate the signature . I have uploaded my sample project to GitHub please find it here. The project can be opened using IntelliJ or Eclipse. The program argument should be set to the

Delete padding of Rectangle in iText PDF signature

你离开我真会死。 提交于 2019-12-11 15:05:53
问题 I have a little app to add a signature to a PDF in JAVA using iText. This is a fragment of the code: PdfReader reader = new PdfReader(pdfBytes); FileOutputStream fos = new FileOutputStream(new File("/home/john/signedPdf.pdf")); PdfStamper stamper = PdfStamper.createSignature( reader, fos, '\0', new File("/home/john/"), true ); PdfSignatureAppearance signatureAppearance = stamper.getSignatureAppearance(); signatureAppearance.setRenderingMode(PdfSignatureAppearance.RenderingMode.DESCRIPTION);

CMDB学习之API加密请求动态

旧城冷巷雨未停 提交于 2019-12-11 13:33:46
#实现是通过时间戳+秘钥进行 MD5 加密处理from django.shortcuts import render,HttpResponse,redirect,reverse from django.views.decorators.csrf import csrf_exempt import json #使用rest_framework ,首先要安装pip去安装Djangorestframework ,这个模块 # 在Django的settings中注册app import hashlib import time from django.conf import settings from rest_framework.views import APIView from rest_framework.response import Response from api import models from api import service #服务端临时测试 KEY = 'alksdgjaldks' #解密 def gen_key(key,ctime): key_str = '{}|{}'.format(key,ctime) md5 = hashlib.md5() md5.update(key_str.encode('utf-8')) return md5.hexdigest()

Deleting files from signed java applet

拟墨画扇 提交于 2019-12-11 12:32:15
问题 I have to delete some temporary file from a users system when he logs out of application. The application has applet. The applet jar is signed. I am following the strategy to call the applet's destroy method to delete files. I am invoking the destroy method of applet by javascript like document.myApplet.destroy() . After invoking this I am getting the error on browser as Uncaught Error: java.security.AccessControlException: access denied (java.io.FilePermission Uncaught Error: Error calling

Can not login and register in laravel 5.1

人盡茶涼 提交于 2019-12-11 10:03:25
问题 After I create two form(login.blade.php and register.blade.php) in views/auth folder and in route: Route::get('auth/login', 'Auth\AuthController@getLogin'); Route::post('auth/login', 'Auth\AuthController@postLogin'); Route::get('auth/logout', 'Auth\AuthController@getLogout'); // Registration routes... Route::get('auth/register', 'Auth\AuthController@getRegister'); Route::post('auth/register', 'Auth\AuthController@postRegister'); I can go to form login and register with http://localhost/crud

Ruby HMAC signing issue

有些话、适合烂在心里 提交于 2019-12-11 06:01:11
问题 I got an issue with HMAC. I have to sign a form before sending it to a bank. They only provide an example in PHP in their documentation. I have a hex key to sign my data (e.g. FCEBA61A884A938E7E7FE4F5C68AA7F4A349768EE5957DDFBE99C1D05A09CBACF1FCF0A7084CB2E4CBA95193176C4395DE7F39EA9DBEBEF0907D77192AAE3E8A ). In the PHP exemple, they do this with the key before signing the data: $key =

Malformed reference element signing a xml file of bills

人走茶凉 提交于 2019-12-11 05:38:57
问题 I'm developing a program to digitally sign invoices in xml. I followed this guide https://www.profissionaisti.com.br/2010/07/assinando-digitalmente-um-xml-usando-c/#comment-197297. However, i'm getting an error Malformed reference element. The code is : static void Main(string[] args) { //open certificates of current user var store = new X509Store(StoreName.My, StoreLocation.CurrentUser); store.Open(OpenFlags.ReadOnly); //Open screen to choose certificate var selectedCertificate =

Digital sign From SHA1 to SHA256

南笙酒味 提交于 2019-12-11 03:23:42
问题 I'm trying to update a function that performs a digital signature, I want to switch from SHA1 SHA256 this is the current function: private byte[] zSignData(Byte[] msg, X509Certificate2 signerCert) { ContentInfo contentInfo = new ContentInfo(msg); SignedCms signedCms = new SignedCms(contentInfo, false); CmsSigner cmsSigner = new CmsSigner(signerCert); cmsSigner.DigestAlgorithm = new Oid("1.3.14.3.2.26"); //SHA1 signedCms.ComputeSignature(cmsSigner, false); return signedCms.Encode(); } this