2012-04-01 17:35:59 +00:00
//
// ViewController . m
// OpenSSL - for - iOS
//
// Created by Felix Schulze on 04.12 .2010 .
// Updated by Schulze Felix on 01.04 .12 .
// Copyright ( c ) 2012 Felix Schulze . All rights reserved .
// Web : http : // www . felixschulze . de
//
# import "ViewController.h"
2013-03-16 20:01:07 +00:00
# import "FSOpenSSL.h"
2012-04-22 08:13:11 +00:00
# include < openssl / opensslv . h >
2012-04-01 17:35:59 +00:00
@ implementation ViewController
@ synthesize textField ;
@ synthesize md5TextField ;
@ synthesize sha256TextField ;
# pragma mark -
# pragma mark OpenSSL
- ( IBAction ) calculateMD5 : ( id ) sender
{
2013-03-16 20:01:07 +00:00
md5TextField . text = [ FSOpenSSL md5FromString : textField . text ] ;
2012-04-01 17:35:59 +00:00
// Hide Keyboard after calculation
[ textField resignFirstResponder ] ;
}
- ( IBAction ) calculateSHA256 : ( id ) sender
2013-03-16 20:01:07 +00:00
{
sha256TextField . text = [ FSOpenSSL sha256FromString : textField . text ] ;
2012-04-01 17:35:59 +00:00
// Hide Keyboard after calculation
[ textField resignFirstResponder ] ;
}
- ( IBAction ) showInfo
{
2013-03-16 20:01:07 +00:00
NSString * message = [ NSString stringWithFormat : @ "OpenSSL-Version: %@\nLicense: See include/LICENSE\n\nCopyright 2010-2013 by Felix Schulze\n http://www.felixschulze.de" , @ OPENSSL_VERSION _TEXT ] ;
2012-04-20 16:49:36 +00:00
UIAlertView * alert = [ [ UIAlertView alloc ] initWithTitle : @ "OpenSSL-for-iOS" message : message delegate : nil cancelButtonTitle : @ "Close" otherButtonTitles : nil ] ;
2012-04-01 17:35:59 +00:00
[ alert show ] ;
}
- ( BOOL ) shouldAutorotateToInterfaceOrientation : ( UIInterfaceOrientation ) interfaceOrientation
{
return ( interfaceOrientation = = UIInterfaceOrientationPortrait ) ;
}
@ end