Skip to content

Instantly share code, notes, and snippets.

View makah's full-sized avatar

makah

View GitHub Profile
public IRegistryService Connect(String name, RSACryptoServiceProvider privateKey, X509Certificate2 acsCertificate) {
if ((String.IsNullOrEmpty(name)) || (acsCertificate == null) ||
(privateKey == null))
throw new ArgumentException("....");
if (!String.IsNullOrEmpty(this.Credential.identifier))
throw new ACSLoginFailureException("....");
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.IO;
using System.Xml;
using OpenbusAPI.Logger;
namespace Security
{
public static class Crypto
using System;
using System.Security.Cryptography;
using System.Text;
using System.IO;
using OpenbusAPI.Logger;
namespace OpenbusAPI.Security
{
/// <summary>
/// **** Fork from <i>Java Science Consulting</i> ***
@makah
makah / promiseCatch.js
Last active February 4, 2016 11:31
Promise Catch: VEr como que o catch da promise funciona
var app = angular.module('myApp', []);
app.controller('myCtrl', function($q, $timeout) {
var errStep = 1;
//Brincar de remover esses catches e mudar o errStep para ver como o catch da promise funciona
//fonte: http://stackoverflow.com/questions/20714460/break-promise-chain-and-call-a-function-based-on-the-step-in-the-chain-where-it
step(1)
.then(function() {