signed

How do I read the digital signature information from a signed .Net assembly?

丶灬走出姿态 提交于 2019-12-04 02:46:12
I am writing an assembly information application to be used in our software build process and am trying to read the digital signature information from a signed .Net assembly. I want to do in my C# code what Windows Explorer can do by right-clicking a signed assembly and selecting the "Digital Signatures" tab and then clicking the Details button. e.g. Has anyone got an idea how to do this programmatically in C#? I am currently using the Mono Cecil library to get the rest of the information from the assembly. Your help will be most appreciated. The Mono project provides source code for both

Get the original content from a signed pdf

我的梦境 提交于 2019-12-03 21:12:46
I would like to know how I could get the original content from a signed pdf document using iText java library or another one. Thanks UPDATE 1: Possible example: PdfReader reader = new PdfReader(PATH_TO_PDF); AcroFields fields = reader.getAcroFields(); ArrayList<String> signatures = fields.getSignatureNames(); for (String signature : signatures) { // Start revision extraction ByteArrayOutputStream out = new ByteArrayOutputStream(); byte bb[] = new byte[8192]; InputStream ip = fields.extractRevision(signature); int n = 0; while ((n = ip.read(bb)) > 0) out.write(bb, 0, n); out.close(); ip.close()

How can I do 64-bit arithmetic in Perl?

一笑奈何 提交于 2019-12-03 19:30:46
问题 I am a perl newbie, Can I simply use 64-bit arithmetic in Perl? For example $operand1 = 0xFFFFFFFFFFFF; # 48 bit value $operand2 = 0xFFFFFFFFFFFF; # 48 bit value $Result = $operand1 * $operand2; I am basically looking for a replacement for the int64_t in perl. Is there any way to mention, if the variable is signed or unsigned? 回答1: Yes, however you need to have Perl compiled with 64-bit support. 回答2: See bigint: Transparent BigInteger support for Perl... All operators (including basic math

Bitwise operators and signed types

依然范特西╮ 提交于 2019-12-03 14:42:44
I'm reading C++ Primer and I'm slightly confused by a few comments which talk about how Bitwise operators deal with signed types. I'll quote: Quote #1 (When talking about Bitwise operators) "If the operand is signed and its value is negative, then the way that the “sign bit” is handled in a number of the bitwise operations is machine dependent. Moreover, doing a left shift that changes the value of the sign bit is undefined" Quote #2 (When talking about the rightshift operator) "If that operand is unsigned, then the operator inserts 0-valued bits on the left; if it is a signed type, the result

Packing two shorts into one int, dealing with negative and positive

心已入冬 提交于 2019-12-03 13:50:35
I'm making a class PackedUnsigned1616 which stores two unsigned shorts in one int, and a class PackedSigned1616 which stores two signed shorts in one int. I've read up on bitwise operations, but I'm still confused on how to deal with signed and unsigned and values that are larger or smaller that a short's range (they are passed in as two ints). Here's what I've got so far: public final class PackedUnsigned1616 { public final int field; private static final int RIGHT = (2 << 15) - 1; private static final int LEFT = ((2 << 31) - 1) ^ RIGHT; public PackedUnsigned1616(int left, int right) { field

How to Install Driver with a cat file?

狂风中的少年 提交于 2019-12-03 05:43:46
问题 I have kernel driver. When installing on 32 bit systems and Windows XP and below, I had no problem and used SetupCopyOEMInf, but 64 bit drivers are required to be signed. I have signed it and I need to have a cat file with the driver copied somewhere on the computer, and this method of install doesn't work. How should I install it? EDIT: Clarified the question. 回答1: In Windows Vista and Windows 7 there a new utility for handling drivers setup call PnPUtil. It handles exactly this kind of work

When should I just use “int” versus more sign-specific or size-specific types?

不羁岁月 提交于 2019-12-03 01:17:56
问题 I have a little VM for a programming language implemented in C. It supports being compiled under both 32-bit and 64-bit architectures as well as both C and C++. I'm trying to make it compile cleanly with as many warnings enabled as possible. When I turn on CLANG_WARN_IMPLICIT_SIGN_CONVERSION , I get a cascade of new warnings. I'd like to have a good strategy for when to use int versus either explicitly unsigned types, and/or explicitly sized ones. So far, I'm having trouble deciding what that

Struct variable doesn't changed by assignment

无人久伴 提交于 2019-12-03 00:16:30
问题 struct st { int a1 : 3; int a2 : 2; int a3 : 1; } void main(void) { x.a3 = -1; if (x.a3 == -1) printf("TRUE\n"); else printf("FALSE\n"); x.a3 = 1; if (x.a3 == 1) printf("TRUE\n"); else printf("FALSE\n"); } In case, 'x.a3 = -1;' First if is TRUE . But, why 'x.a3 = 1' doesn't changed in second if ? It's still x.a3 = -1. And If I type 'x.a3 = 1;' in first if, it still x.a3 = = 1 !! It doesn't changed! Debug Result in XCode 回答1: The problem is, a signed 1 bit variable can hold only two values, -1

How to Install Driver with a cat file?

扶醉桌前 提交于 2019-12-02 19:04:49
I have kernel driver. When installing on 32 bit systems and Windows XP and below, I had no problem and used SetupCopyOEMInf, but 64 bit drivers are required to be signed. I have signed it and I need to have a cat file with the driver copied somewhere on the computer, and this method of install doesn't work. How should I install it? EDIT: Clarified the question. SurDin In Windows Vista and Windows 7 there a new utility for handling drivers setup call PnPUtil . It handles exactly this kind of work. Just copy all your driver relevant files(*.inf, *.cat, *.sys) to a directory on the target

Signed int range confusion

﹥>﹥吖頭↗ 提交于 2019-12-02 14:13:44
This question might be very basic but i post here only after days of googling and for my proper basic understanding of signed integers in C. Actually some say signed int has range -32767 to 32767 and others say it has range -32768 to 32767 Let us have int a=5 (signed / let us consider just 1 byte) *the 1st representation of a=5 is represented as 00000101 as a positive number and a=-5 is represented as 10000101 (so range -32767 to 32767 justified) (here the msb/sign bit is 1/0 the number will be positive/negative and rest(magnitude bits) are unchanged ) *the 2nd representation of a=5 is