Posts

c - How to decrypt data using RSA public key? -

let me introduce problem, have *.crt file, contains der encoded x509 version 3 certificate. using asn1 der(libtomcrypt) decrypt data , save structure called x509v3 . have message m, encrypted signature of m -> s(rsa encrypted), , public key -> p located inside x509 certificate(subject public key field). first must decrypt s using public key p, problem can't find api this? looked libtomcrypt seems there no api takes public key( unsigned char * ) , encrypted data (also unsigned char *) , gives decrypted data( unsigned char *). thanks help! p.s. sorry english;) you 1 of countless victims of historical sloppy presentation of signatures, has created , still creates massive amounts of confusion. what have signature , want verify it. there exist several signature algorithms, , 1 of them called "rsa" because looks similar asymmetric encryption algorithm called similar. rough description of rsa signatures "you encrypt private key" (i.e. taking...

c# - OAuth client credentials (key + secret) needed in a desktop app even with valid token credentials -

i under impression once authorization process done, access token , secret (token credentials) needed use target resource. according quote [ in cases, client credentials cannot trusted , can used informational purposes only, such in desktop application clients ] may not case. running problem after authorization consumer key , secret (client credentials) still needed in order access resource. not seem right. i have implemented oauth in desktop application looking dotnetopenauth samples. have used unchanged inmemorytokenmanager , desktopconsumer , works once authorized. when restart app , reuse saved token credentials, app fails access resource. if used saved token credentials + client credentials, resource accessed alright. design? sounds incorrect no expert. this correct. per oauth 1.0 spec, client credentials required every time use access token. protects leaked access token being exploited client. reasoning assumes client secret in fact secret, point out cannot a...

oop - PHP Getting a reference through a constructor? -

i wondering if possible while using keyword 'new' return reference existing object instead of new object. , if not, best way avoid co-existence of objects same parameters? i have class arguments on constructor. if using arguments similar ones of existing instance, i'd new object reference existing one. possible? understand different singleton in case can have several instances of same class, not several instances using same parameters. class myclass{ public $signature; /* unique signature connection */ public static $instances = array(); /* array of references connection */ private static function singleton($cfg,$inst){ $signature = sha1(serialize($cfg)); foreach ( self::$instances $obj ) { if ( $obj->signature == $signature ) return $obj; } array_push(self::$instances,$inst); return true; } function __construct($myparam){ if ( is_object(self::singleton($myparam,$this) ) // here i'd $this become ref of existing obje...

.net - smtpclient.sendasync fails to work with too many recipients -

this application wpf windows application using c#, i trying send email long list of recipients. let me state @ outset not spam these people have signed list. i using smtpclient.sendasync. works fine in testing when send 1 3 people when send whole mailing list, fails work. number on list 2623. there no error message; it’s receipts don’t email. problem debug because can’t test by, example, sending 100 people because spamming. see code below. note changed email addresses prevent spamming. int32 _messagecount = 0; mailmessage msg = new mailmessage(); smtpclient client = new smtpclient(configuration.smtpserver); string _prioremail = ""; msg.from = new mailaddress("a@b.com"); msg.to.add (new mailaddress("a@b.com")); // bcc list foreach (string str in emailtoaddresses) { if (clsutilities.isanemail(str) == true && str != _priorema...

google app engine - Unable to update app: Failed to compile JSP Files -

i'm trying deploy app first time on app engine , i'm getting error saying "unable update app: failed compile jsp files". have ideas how can fix this. i've set eclipse point jdk1.6.0_17 in windows/preferences/java/installed jres. java_home set "c:\program files\java\jdk1.6.0_17". i've edited appcfg.cmd file in "appengine-java-sdk-1.4.2\bin" folder following: @"%java_home%"\bin\java -cp "%~dp0\..\lib\appengine-tools-api.jar" com.google.appengine.tools.admin.appcfg %* any ideas why happening? thanks you have both jre , jdk , eclipse uses jre when deploying problem. should use jdk. uninstall jre (using programs , features control panel). make sure path set jdk. if don't see add in path variable. should like: c:\program files\java\jdk\bin. adapt based on own config.

objective c - NSNumberFormatterCurrencyStyle number formatter without decimal digits -

i want price rounded displayed currency without digits after decimal symbol. without currency style there no problem. currency style overriding other properties set? after set currency style, try [currencyformatter setmaximumfractiondigits:0]; you may need set rounding mode well.

javascript - How to create page section based on JSON -

i have jquery slider code want populate via json url. below sample json starting with: { "context": null, "isgeneric": false, "items": [ { "description": "lorem ipsum dolor sit amet, consectetur adipiscing elit. nulla tincidunt condimentum lacus. pellentesque ut diam....<a href="#" >read more</a>", "mediaurl": "\/images\/image1.jpg", "alternativetext": "15+ excellent high speed photographs", "height": 1050, "thumbnailurl": "\/images\/image1-thb.jpg", "width": 1680 }, { "description": "vestibulum leo quam, accumsan nec porttitor a, euismod ac tortor. sed ipsum lorem, sagittis non egestas id, suscipit....<a href="#" >read more</a>", "mediaurl": "\/images\/image2.jpg", "alternativetext": ...