phpseclib

How to validate signature with phpseclib, in a XML signature message?

点点圈 提交于 2019-12-13 05:42:50
问题 I tested the final XML signature file and it sends, "invalid signatures", why? Information: I have prepared this inf. to be signed with XML signature: <?xml version="1.0" encoding="UTF-8" standalone="no"?><SolicitudRegistro xmlns="http://www.cie.mx/SCG/Inilidad" IdMensaje="f2-8505d81914c"> <FechaEnvio>2013-02-26T21:08:36</FechaEnvio> <Registrante EndPoint="https://200.34.175.46:443/InteropOPE /MensajeidadService" Nombre="Instigua" NombreCorto="IMTA" URI="op.mx"> <DatosDeContacto AreaOficina=

Adding subjectAltName to csr using phpseclib

主宰稳场 提交于 2019-12-12 06:08:11
问题 I am using phpseclib to generate private key, public key and CSR and i just want to be able to include subjectAltName to the Public key and CSR in the process but the documentation is no good. I tried using setDomain but all that does is overides the primary commonName value.. I found this from another post but it doesn't seem to have any effect: $x509->setExtension('id-ce-subjectAltName', array('san1.domain.com', 'san2.domain.com')); -- UPDATE -- I am step closer, I see the extension for

phpseclib user cert for tls authetication

孤街浪徒 提交于 2019-12-12 04:54:15
问题 Update: I have rewritten the sample code and the CSR is very close to the actual openssl created CSR (only missing the CA:False extended attribute) I have a CA already and would like to dynamically generate user certs for enrolling authorized devices with phpseclib. I know the logic is a little cloudy, this code was pieced together from a variety of different examples: <?php $USERNAME = "tester"; $DEVICENAME = "command"; $PASSWORD = "test"; $ID = 123; require_once("config.inc.php"); // Sets

RSA encryption from From C# to PHP

只愿长相守 提交于 2019-12-12 03:59:33
问题 I need to connect to a certain webservice that uses RSA encryption. Using NuSOAP and PHPseclib I can connect to the server to get the public key used to RSA encrypt and send back data to the server. Problem arise in the way they are encrypting the data, the developer there gave me documentation and sample written in C# to which is hard to comprehend and convert to PHP. The only thing that needs to be encrypted is the password. using System; using System.Collections.Generic; using System.Linq;

Phpseclib “Invalid HMAC” on Windows, Works on LAMP/MAMP

冷暖自知 提交于 2019-12-12 02:47:10
问题 Trying to get a simple SFTP file transfer working in PHP with phpseclib. Here's the code: <?php ini_set('display_errors', '1'); error_reporting(E_ALL); include_once ('Net/SFTP.php'); define('NET_SSH2_LOGGING', NET_SSH2_LOG_COMPLEX); $sftp = new Net_SFTP("foo.example.com"); if (!$sftp->login("username", "password")) { echo($sftp->getLog()); exit('Login Failed'); } echo($sftp->getLog()); $sftp->get("remotefile.txt", "localfile.txt"); ?> It works perfectly everywhere but on the Windows/Apache

Parse “passwd” command with phpseclib

限于喜欢 提交于 2019-12-12 01:40:04
问题 I tried to parse "passwd" command to my machine with phpseclib but it can't go through the first password typing. Look at the code below. $ssh->write(" passwd $new_user\n $new_user_pw\n $new_user_pw\n "); $ssh->setTimeout(5); echo $ssh->read('root@machine:~$'); Output i got is: Last login: Tue Jun 17 12:23:01 2014 from 109.175.60.43 [root@machine ~]# [root@machine ~]# [root@machine ~]# passwd 8917f498 Changing password for user 8917f498. New password: Or can I do this with another way? Thanks

phpseclib - endless downloading

痴心易碎 提交于 2019-12-11 21:37:19
问题 I'm using phpseclib 0.3.1 for working with remote SFTP server. I have a script which downloads cover images from the SFTP, save them on my server and make updates in database. I run this script for 7000 images and after nearly 10-12 minutes, it looks like script has stopped (but eventually I have found out that script entered an endless loop) After some investigation, I have found the following details: function get($remote_file, $local_file = false) from SFTP.php is called for downloading

Setting ns-cert-type server for OpenVPN using phpseclib

感情迁移 提交于 2019-12-11 14:17:25
问题 Since the documentation for phpseclib is very poor, I'm asking here if there is a way to set the ns-cert-type for a certificate whis this library. Searching on the sources, I've found this: // the following OIDs are unsupported but we don't want them to give notices when calling saveX509(). case 'id-pe-logotype': // http://www.ietf.org/rfc/rfc3709.txt case 'entrustVersInfo': // http://support.microsoft.com/kb/287547 case '1.3.6.1.4.1.311.20.2': // szOID_ENROLL_CERTTYPE_EXTENSION case '1.3.6.1

Cannot get phpseclib to connect - error 10060

爷,独闯天下 提交于 2019-12-11 11:35:31
问题 I cannot get my local environment, Win7 running easyPHP 12, to connect to my server, ubuntu 11.04. I connect to my server via sftp with filezilla fine, i can connect to my server via ssh with putty fine... the server requires no keys at the moment just a uname and pword... I don't get it, the details i am passing via the php script are exactly the same as the ones i pass from filezilla and putty. This is the code stripped to the bare basic: //inlcude the phpseclib path in the include array

phpseclib cant parse CSR from Microsoft CA?

假如想象 提交于 2019-12-11 11:07:47
问题 In my ongoing struggle with public key crypto i ran into a snag that's possibly beyond my expertise with parsing CSR's: I have not been able to get phpseclib to X509->loadCSR() this chunk from a MS server 2012r2 CA: # more file -----BEGIN NEW CERTIFICATE REQUEST----- MIIFGDCCAwACAQAwOjEWMBQGCgmSJomT8ixkARkWBnNlY3VyZTEgMB4GA1UEAxMX LlNlY3VyZSBFbnRlcnByaXNlIENBIDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw ggIKAoICAQCzgEpL+Za7a3y7YpURDrxlGIBlks25fD0tHaZIYkBTaXA5h+9MWoXn