├── .dockerignore ├── .gitattributes ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── Dockerfile ├── Jenkinsfile ├── LICENSE ├── README.md ├── build.gradle ├── deploy.gradle ├── generate_v2.sh ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── src └── com │ └── codeborne │ └── security │ ├── AuthenticationException.java │ ├── digidoc │ ├── AsyncResponderStatistics.java │ ├── CRLInfo.java │ ├── CertificateInfo.java │ ├── CertificatePolicy.java │ ├── ClientStatistics.java │ ├── ConfirmationInfo.java │ ├── DataFileAttribute.java │ ├── DataFileData.java │ ├── DataFileDigest.java │ ├── DataFileDigestList.java │ ├── DataFileInfo.java │ ├── DigiDocServicePortType.java │ ├── DigiDocServiceStub.java │ ├── DigiDocService_Service.java │ ├── DigiDocService_ServiceLocator.java │ ├── Error.java │ ├── OperatorStatistics.java │ ├── RevokedInfo.java │ ├── SignatureInfo.java │ ├── SignatureModule.java │ ├── SignatureModulesArray.java │ ├── SignatureProductionPlace.java │ ├── SignatureType.java │ ├── SignedDocInfo.java │ ├── SignerInfo.java │ ├── SignerRole.java │ ├── StatusCodeType.java │ ├── StatusType.java │ ├── TstInfo.java │ └── holders │ │ ├── AsyncResponderStatisticsHolder.java │ │ ├── ClientStatisticsHolder.java │ │ ├── DataFileDataHolder.java │ │ ├── OperatorStatisticsHolder.java │ │ ├── SignatureModulesArrayHolder.java │ │ └── SignedDocInfoHolder.java │ ├── digidoc_v2 │ ├── AbstractGetStatusRequestType.java │ ├── AbstractGetStatusResponseType.java │ ├── AbstractRequestType.java │ ├── AbstractResponseType.java │ ├── CertStatusType.java │ ├── EndpointError.java │ ├── GetMobileAuthenticateStatusRequest.java │ ├── GetMobileAuthenticateStatusResponse.java │ ├── GetMobileSignHashStatusRequest.java │ ├── GetMobileSignHashStatusResponse.java │ ├── HashType.java │ ├── KeyID.java │ ├── LanguageType.java │ ├── MobileAuthenticateRequest.java │ ├── MobileAuthenticateResponse.java │ ├── MobileId.java │ ├── MobileIdService.java │ ├── MobileIdServiceLocator.java │ ├── MobileIdServiceStub.java │ ├── MobileSignHashRequest.java │ ├── MobileSignHashResponse.java │ ├── ProcessStatusType.java │ └── SessionAwareType.java │ └── mobileid │ ├── MobileIDAuthenticator.java │ ├── MobileIDSession.java │ └── test │ └── MobileIDAuthenticatorStub.java └── test ├── com └── codeborne │ └── security │ └── mobileid │ ├── HelloMobileID.java │ ├── HelloMobileIDByPersonalCode.java │ ├── MobileIDAuthenticatorTest.java │ ├── MobileIDSessionTest.java │ └── test │ └── MobileIDAuthenticatorStubTest.java └── keystore.jks /.dockerignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /.*.iml 3 | /build 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.jks binary 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /*.iml 2 | /.idea 3 | /.gradle 4 | /out 5 | /classes 6 | /build 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | sudo: false 3 | cache: 4 | directories: 5 | - $HOME/.gradle 6 | 7 | script: "./gradlew clean test" 8 | 9 | jdk: 10 | - oraclejdk8 -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## 1.4 (released 05.10.2018) 4 | * #10 mobileID does not work with Lithuanian numbers 5 | * NB! Phone number without country code is not supported anymore! Only "+37255667788" or "37255667788" or "37055667788". 6 | 7 | ## 1.3 (released 04.04.2018) 8 | * Add support for https://digidocservice.sk.ee/v2/mid.wsdl 9 | 10 | ## 1.2 (released 27.12.2017) 11 | * #8 fix login by personal code 12 | * change license to less restrictive MIT 13 | * upgrade to Java8 14 | 15 | ## 1.1 (released 08.10.2015) 16 | * upgrade to Java7 17 | * Fixed sample application. 18 | * The URL to test service has changed and corrupted keystore. 19 | 20 | ## 1.0 (released 10.07.2015) -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:8-alpine 2 | 3 | COPY . /build 4 | WORKDIR ./build 5 | RUN ./gradlew check jar 6 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | 4 | environment { 5 | REPO_NAME = "${env.JOB_NAME.split('/')[1]}" 6 | DEST = "/var/www/repo/com/codeborne/mobileid" 7 | } 8 | 9 | stages { 10 | stage('Build') { 11 | steps { 12 | sh 'docker build -t $REPO_NAME .' 13 | } 14 | } 15 | stage('Publish') { 16 | steps { 17 | sh 'mkdir -p $DEST' 18 | sh 'docker run -v /var/www/repo:/var/www/repo $REPO_NAME sh -c "cp build/libs/mobileid*.jar $DEST"' 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) [2015] [Andrei Solntsev] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Mobile-ID 2 | ========= 3 | 4 | **Obsolete**: this library used the SOAP/WSDL API for Mobile-ID, which has now be replaced by a new REST API. 5 | 6 | [Mobile-ID](http://www.id.ee/?id=10995&&langchange=1) (Mobiil-ID) is a personal mobile identity in Estonia and Lithuania, 7 | provided by an additional application on a SIM card. The good thing is that it 8 | is backed by government and provides the same level of security for authentication 9 | and digital signatures as a national ID card without the need of having a smart card reader. 10 | 11 | Java and Mobile-ID 12 | ================== 13 | 14 | The official Mobile-ID API is a SOAP web service, so it usually takes time to generate the code and 15 | start using it in a Java application. 16 | 17 | This small library tries to solve this problem: just add the [*mobileid.jar* (with dependencies)](http://mvnrepository.com/artifact/com.codeborne) 18 | to your project and you have a working Mobile-ID support. It already contains all the generated classes (by axis v1) as well as a simplified API of our own. 19 | 20 | The same jar works in Scala as well or any other JVM-based language. 21 | 22 | You can also use Maven/Ivy/Gradle/SBT or your favorite dependency manager that can fetch jars from the official Maven2 repo: 23 | 24 | [com.codeborne :: mobileid](http://mvnrepository.com/artifact/com.codeborne/mobileid) 25 | 26 | Usage 27 | ===== 28 | 29 | Just use the public methods in [MobileIDAuthenticator](http://github.com/codeborne/mobileid/blob/master/src/com/codeborne/security/mobileid/MobileIDAuthenticator.java) class: 30 | 31 | * startLogin(phoneNumber) - to initiate the login session, which will send a flash message to your mobile phone. The returned MobileIDSession contains the challenge code that you need to display to the user. 32 | * waitForLogin(session) - to wait until user finally signs the challenge. This is a blocking call for simplicity. 33 | * isLoginComplete(session) - if you want to do polling from the client side 34 | 35 | See working example in [HelloMobileID.java](http://github.com/codeborne/mobileid/blob/master/test/com/codeborne/security/mobileid/HelloMobileID.java) - run the main() method. 36 | 37 | # Thanks 38 | 39 | Many thanks to these incredible tools that help us creating open-source software: 40 | 41 | ![Intellij IDEA](http://www.jetbrains.com/idea/docs/logo_intellij_idea.png) 42 | 43 | ![YourKit Java profiler](http://selenide.org/images/yourkit.png) 44 | 45 | # License 46 | mobile-id is open-source project and distributed under [MIT](http://choosealicense.com/licenses/mit/) license 47 | 48 | [![Build Status](https://travis-ci.org/codeborne/mobileid.svg?branch=master)](https://travis-ci.org/codeborne/mobileid) 49 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | apply plugin: 'maven' 3 | apply plugin: 'maven-publish' 4 | 5 | group = 'com.codeborne' 6 | archivesBaseName = 'mobileid' 7 | version = '1.4.2-SNAPSHOT' 8 | 9 | defaultTasks 'clean', 'test', 'install' 10 | 11 | repositories{ 12 | mavenCentral() 13 | } 14 | 15 | sourceSets { 16 | main { 17 | java { 18 | srcDir 'src' 19 | } 20 | } 21 | test { 22 | java { 23 | srcDir 'test' 24 | } 25 | } 26 | } 27 | 28 | sourceCompatibility = 1.8 29 | targetCompatibility = 1.8 30 | 31 | compileJava.options.debugOptions.debugLevel = "source,lines,vars" 32 | [compileJava, compileTestJava, javadoc]*.options.collect {options -> 33 | options.encoding = 'UTF-8' 34 | } 35 | 36 | [compileJava, compileTestJava]*.options.collect {options -> 37 | options.debug = true 38 | options.deprecation = true 39 | options.compilerArgs.add '-Xlint' 40 | options.compilerArgs.add '-Xlint:-unchecked' 41 | options.compilerArgs.add '-Xlint:-serial' 42 | options.compilerArgs.add '-Xlint:-rawtypes' 43 | } 44 | 45 | dependencies { 46 | compile 'org.apache.axis:axis:1.4' 47 | compile 'org.apache.axis:axis-jaxrpc:1.4' 48 | compile 'commons-discovery:commons-discovery:0.5' 49 | compile 'wsdl4j:wsdl4j:1.6.3' 50 | testCompile 'junit:junit:4.12' 51 | testCompile 'org.hamcrest:hamcrest-core:1.3' 52 | testCompile 'org.mockito:mockito-core:2.23.4' 53 | } 54 | 55 | task libs(type: Sync) { 56 | from configurations.compile 57 | from configurations.testCompile 58 | into "$buildDir/lib" 59 | } 60 | 61 | compileJava.dependsOn libs 62 | 63 | task sourcesJar(type: Jar, dependsOn:classes) { 64 | classifier = 'sources' 65 | from sourceSets.main.allSource 66 | } 67 | 68 | task javadocJar(type: Jar, dependsOn:javadoc) { 69 | classifier = 'javadoc' 70 | from javadoc.destinationDir 71 | } 72 | 73 | artifacts { 74 | archives jar 75 | archives sourcesJar 76 | archives javadocJar 77 | } 78 | 79 | -------------------------------------------------------------------------------- /deploy.gradle: -------------------------------------------------------------------------------- 1 | apply from: 'build.gradle' 2 | apply plugin: 'signing' 3 | 4 | defaultTasks 'clean', 'test', 'install', 'uploadArchives' 5 | 6 | signing { 7 | sign configurations.archives 8 | } 9 | 10 | uploadArchives { 11 | repositories { 12 | mavenDeployer { 13 | beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } 14 | 15 | repository(url: project.version.endsWith("-SNAPSHOT") ? 16 | 'https://oss.sonatype.org/content/repositories/snapshots/' : 17 | 'https://oss.sonatype.org/service/local/staging/deploy/maven2/') { 18 | authentication(userName: "$sonatypeUsername", password: "$sonatypePassword") 19 | } 20 | 21 | pom.project { 22 | name archivesBaseName 23 | packaging 'jar' 24 | description 'Java wrapper for Mobile-ID' 25 | url 'https://github.com/codeborne/mobileid' 26 | 27 | scm { 28 | url 'scm:git@github.com:codeborne/mobileid.git' 29 | connection 'scm:git@github.com:codeborne/mobileid.git' 30 | developerConnection 'scm:git@github.com:codeborne/mobileid.git' 31 | } 32 | 33 | licenses { 34 | license { 35 | name 'GPL 1.0' 36 | url 'http://www.gnu.org/copyleft/gpl.html' 37 | distribution 'repo' 38 | } 39 | } 40 | 41 | developers { 42 | developer { 43 | id 'angryziber' 44 | name 'Anton Keks' 45 | } 46 | developer { 47 | id 'asolntsev' 48 | name 'Andrei Solntsev' 49 | } 50 | } 51 | } 52 | 53 | //mess with the generated pom to set the 'packaging' tag 54 | pom.withXml { XmlProvider xmlProvider -> 55 | def xml = xmlProvider.asString() 56 | def pomXml = new XmlParser().parse(new ByteArrayInputStream(xml.toString().bytes)) 57 | 58 | pomXml.version[0] + { packaging('jar') } 59 | 60 | def newXml = new StringWriter() 61 | def printer = new XmlNodePrinter(new PrintWriter(newXml)) 62 | printer.preserveWhitespace = true 63 | printer.print(pomXml) 64 | xml.setLength(0) 65 | xml.append(newXml.toString()) 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /generate_v2.sh: -------------------------------------------------------------------------------- 1 | java -Djavax.net.ssl.trustStore=test/keystore.jks -cp build/lib/axis-1.4.jar:build/lib/commons-logging-1.1.1.jar:build/lib/commons-discovery-0.5.jar:build/lib/wsdl4j-1.6.3.jar:build/lib/axis-jaxrpc-1.4.jar org.apache.axis.wsdl.WSDL2Java -a https://digidocservice.sk.ee/v2/mid.wsdl 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeborne/mobileid/3902719f26146a94e2b6ca5d2ff79e571c634300/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.0-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS='"-Xmx64m"' 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS="-Xmx64m" 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /src/com/codeborne/security/AuthenticationException.java: -------------------------------------------------------------------------------- 1 | package com.codeborne.security; 2 | 3 | import org.apache.axis.AxisFault; 4 | 5 | import java.rmi.RemoteException; 6 | 7 | import static java.lang.Integer.parseInt; 8 | 9 | public class AuthenticationException extends RuntimeException { 10 | public enum Code { 11 | // Codes for mobileAuthenticate service: 12 | SERVICE_ERROR(100, "Teenuse üldine veasituatsioon"), 13 | INVALID_INPUT(101, "Sisendparameetrid mittekorrektsel kujul"), 14 | MISSING_INPUT(102, "Mõni kohustuslik sisendparameeter on määramata"), 15 | METHOD_NOT_ALLOWED(103, "Ligipääs antud meetodile antud parameetritega piiratud (näiteks kasutatav ServiceName ei ole teenuse pakkuja juures registreeritud)"), 16 | AUTHENTICATION_ERROR(200, "Teenuse üldine viga"), 17 | USER_CERTIFICATE_MISSING(201, "Kasutaja sertifikaat puudub"), 18 | UNABLE_TO_TEST_USER_CERTIFICATE(202, "Kasutaja sertifikaadi kehtivus ei ole võimalik kontrollida"), 19 | USER_PHONE_ERROR(300, "Kasutajaga telefoniga seotud üldine viga"), 20 | NO_AGREEMENT(301, "Kasutajal pole Mobiil-ID lepingut"), 21 | CERTIFICATE_REVOKED(302, "Kasutaja sertifikaat ei kehti (OCSP vastus REVOKED)."), 22 | NOT_ACTIVATED(303, "Kasutajal pole Mobiil-ID aktiveeritud. Aktiveerimiseks tuleks minna aadressile http://mobiil.id.ee"), 23 | NOT_VALID(304, "Toiming on lõppenud, kuid kasutaja poolt tekitatud signatuur ei ole kehtiv."), // Authentication failed: generated signature is not valid! 24 | CERTIFICATE_EXPIRED(305, "Kasutaja sertifikaat on aegunud"), 25 | 26 | // Codes for GetMobileAuthenticateStatus service: 27 | USER_AUTHENTICATED(0, "autentimine õnnestus"), 28 | OUTSTANDING_TRANSACTION(200, "autentimine alles toimub"), 29 | EXPIRED_TRANSACTION(0, "Sessioon on aegunud"), 30 | USER_CANCEL(0, "Kasutaja katkestas"), 31 | MID_NOT_READY(0, "Mobiil-ID funktsionaalsus ei ole veel kasutatav, proovida mõne aja pärast uuesti"), 32 | PHONE_ABSENT(0, "Telefon ei ole levis"), 33 | SENDING_ERROR(0, "Muu sõnumi saatmise viga (telefon ei suuda sõnumit vastu võtta, sõnumikeskus häiritud)"), 34 | SIM_ERROR(0, "SIM rakenduse viga"), 35 | INTERNAL_ERROR(0, "Teenuse tehniline viga"); 36 | 37 | private final int code; 38 | private final String descriptionInEstonian; 39 | 40 | Code(int code, String descriptionInEstonian) { 41 | this.code = code; 42 | this.descriptionInEstonian = descriptionInEstonian; 43 | } 44 | 45 | public int getCode() { 46 | return code; 47 | } 48 | } 49 | 50 | private Code code; 51 | 52 | public AuthenticationException(Code code, String details, Throwable throwable) { 53 | super(code + ": " + details, throwable); 54 | this.code = code; 55 | } 56 | 57 | public AuthenticationException(Code code) { 58 | super(code.toString()); 59 | this.code = code; 60 | } 61 | 62 | public AuthenticationException(RemoteException e) { 63 | this(findCode(e.getMessage()), e instanceof AxisFault ? ((AxisFault)e).getFaultDetails()[0].getTextContent() : null, e); 64 | } 65 | 66 | private static Code findCode(String codeAsString) { 67 | try { 68 | int code = parseInt(codeAsString); 69 | for (Code c : Code.values()) { 70 | if (c.code == code) return c; 71 | } 72 | } 73 | catch (NumberFormatException e) { 74 | // just return below 75 | } 76 | return Code.SERVICE_ERROR; 77 | } 78 | 79 | public Code getCode() { 80 | return code; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc/CertificatePolicy.java: -------------------------------------------------------------------------------- 1 | /** 2 | * CertificatePolicy.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc; 9 | 10 | public class CertificatePolicy implements java.io.Serializable { 11 | private java.lang.String OID; 12 | 13 | private java.lang.String URL; 14 | 15 | private java.lang.String description; 16 | 17 | public CertificatePolicy() { 18 | } 19 | 20 | public CertificatePolicy( 21 | java.lang.String OID, 22 | java.lang.String URL, 23 | java.lang.String description) { 24 | this.OID = OID; 25 | this.URL = URL; 26 | this.description = description; 27 | } 28 | 29 | 30 | /** 31 | * Gets the OID value for this CertificatePolicy. 32 | * 33 | * @return OID 34 | */ 35 | public java.lang.String getOID() { 36 | return OID; 37 | } 38 | 39 | 40 | /** 41 | * Sets the OID value for this CertificatePolicy. 42 | * 43 | * @param OID 44 | */ 45 | public void setOID(java.lang.String OID) { 46 | this.OID = OID; 47 | } 48 | 49 | 50 | /** 51 | * Gets the URL value for this CertificatePolicy. 52 | * 53 | * @return URL 54 | */ 55 | public java.lang.String getURL() { 56 | return URL; 57 | } 58 | 59 | 60 | /** 61 | * Sets the URL value for this CertificatePolicy. 62 | * 63 | * @param URL 64 | */ 65 | public void setURL(java.lang.String URL) { 66 | this.URL = URL; 67 | } 68 | 69 | 70 | /** 71 | * Gets the description value for this CertificatePolicy. 72 | * 73 | * @return description 74 | */ 75 | public java.lang.String getDescription() { 76 | return description; 77 | } 78 | 79 | 80 | /** 81 | * Sets the description value for this CertificatePolicy. 82 | * 83 | * @param description 84 | */ 85 | public void setDescription(java.lang.String description) { 86 | this.description = description; 87 | } 88 | 89 | private java.lang.Object __equalsCalc = null; 90 | public synchronized boolean equals(java.lang.Object obj) { 91 | if (!(obj instanceof CertificatePolicy)) return false; 92 | CertificatePolicy other = (CertificatePolicy) obj; 93 | if (obj == null) return false; 94 | if (this == obj) return true; 95 | if (__equalsCalc != null) { 96 | return (__equalsCalc == obj); 97 | } 98 | __equalsCalc = obj; 99 | boolean _equals; 100 | _equals = true && 101 | ((this.OID==null && other.getOID()==null) || 102 | (this.OID!=null && 103 | this.OID.equals(other.getOID()))) && 104 | ((this.URL==null && other.getURL()==null) || 105 | (this.URL!=null && 106 | this.URL.equals(other.getURL()))) && 107 | ((this.description==null && other.getDescription()==null) || 108 | (this.description!=null && 109 | this.description.equals(other.getDescription()))); 110 | __equalsCalc = null; 111 | return _equals; 112 | } 113 | 114 | private boolean __hashCodeCalc = false; 115 | public synchronized int hashCode() { 116 | if (__hashCodeCalc) { 117 | return 0; 118 | } 119 | __hashCodeCalc = true; 120 | int _hashCode = 1; 121 | if (getOID() != null) { 122 | _hashCode += getOID().hashCode(); 123 | } 124 | if (getURL() != null) { 125 | _hashCode += getURL().hashCode(); 126 | } 127 | if (getDescription() != null) { 128 | _hashCode += getDescription().hashCode(); 129 | } 130 | __hashCodeCalc = false; 131 | return _hashCode; 132 | } 133 | 134 | // Type metadata 135 | private static org.apache.axis.description.TypeDesc typeDesc = 136 | new org.apache.axis.description.TypeDesc(CertificatePolicy.class, true); 137 | 138 | static { 139 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "CertificatePolicy")); 140 | org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); 141 | elemField.setFieldName("OID"); 142 | elemField.setXmlName(new javax.xml.namespace.QName("", "OID")); 143 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 144 | elemField.setMinOccurs(0); 145 | elemField.setNillable(true); 146 | typeDesc.addFieldDesc(elemField); 147 | elemField = new org.apache.axis.description.ElementDesc(); 148 | elemField.setFieldName("URL"); 149 | elemField.setXmlName(new javax.xml.namespace.QName("", "URL")); 150 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 151 | elemField.setMinOccurs(0); 152 | elemField.setNillable(true); 153 | typeDesc.addFieldDesc(elemField); 154 | elemField = new org.apache.axis.description.ElementDesc(); 155 | elemField.setFieldName("description"); 156 | elemField.setXmlName(new javax.xml.namespace.QName("", "Description")); 157 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 158 | elemField.setMinOccurs(0); 159 | elemField.setNillable(true); 160 | typeDesc.addFieldDesc(elemField); 161 | } 162 | 163 | /** 164 | * Return type metadata object 165 | */ 166 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 167 | return typeDesc; 168 | } 169 | 170 | /** 171 | * Get Custom Serializer 172 | */ 173 | public static org.apache.axis.encoding.Serializer getSerializer( 174 | java.lang.String mechType, 175 | java.lang.Class _javaType, 176 | javax.xml.namespace.QName _xmlType) { 177 | return 178 | new org.apache.axis.encoding.ser.BeanSerializer( 179 | _javaType, _xmlType, typeDesc); 180 | } 181 | 182 | /** 183 | * Get Custom Deserializer 184 | */ 185 | public static org.apache.axis.encoding.Deserializer getDeserializer( 186 | java.lang.String mechType, 187 | java.lang.Class _javaType, 188 | javax.xml.namespace.QName _xmlType) { 189 | return 190 | new org.apache.axis.encoding.ser.BeanDeserializer( 191 | _javaType, _xmlType, typeDesc); 192 | } 193 | 194 | } 195 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc/ClientStatistics.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ClientStatistics.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc; 9 | 10 | public class ClientStatistics implements java.io.Serializable { 11 | private java.lang.String client; 12 | 13 | private int totalClientSessions; 14 | 15 | private int activeClientSessions; 16 | 17 | private int callRate; 18 | 19 | public ClientStatistics() { 20 | } 21 | 22 | public ClientStatistics( 23 | java.lang.String client, 24 | int totalClientSessions, 25 | int activeClientSessions, 26 | int callRate) { 27 | this.client = client; 28 | this.totalClientSessions = totalClientSessions; 29 | this.activeClientSessions = activeClientSessions; 30 | this.callRate = callRate; 31 | } 32 | 33 | 34 | /** 35 | * Gets the client value for this ClientStatistics. 36 | * 37 | * @return client 38 | */ 39 | public java.lang.String getClient() { 40 | return client; 41 | } 42 | 43 | 44 | /** 45 | * Sets the client value for this ClientStatistics. 46 | * 47 | * @param client 48 | */ 49 | public void setClient(java.lang.String client) { 50 | this.client = client; 51 | } 52 | 53 | 54 | /** 55 | * Gets the totalClientSessions value for this ClientStatistics. 56 | * 57 | * @return totalClientSessions 58 | */ 59 | public int getTotalClientSessions() { 60 | return totalClientSessions; 61 | } 62 | 63 | 64 | /** 65 | * Sets the totalClientSessions value for this ClientStatistics. 66 | * 67 | * @param totalClientSessions 68 | */ 69 | public void setTotalClientSessions(int totalClientSessions) { 70 | this.totalClientSessions = totalClientSessions; 71 | } 72 | 73 | 74 | /** 75 | * Gets the activeClientSessions value for this ClientStatistics. 76 | * 77 | * @return activeClientSessions 78 | */ 79 | public int getActiveClientSessions() { 80 | return activeClientSessions; 81 | } 82 | 83 | 84 | /** 85 | * Sets the activeClientSessions value for this ClientStatistics. 86 | * 87 | * @param activeClientSessions 88 | */ 89 | public void setActiveClientSessions(int activeClientSessions) { 90 | this.activeClientSessions = activeClientSessions; 91 | } 92 | 93 | 94 | /** 95 | * Gets the callRate value for this ClientStatistics. 96 | * 97 | * @return callRate 98 | */ 99 | public int getCallRate() { 100 | return callRate; 101 | } 102 | 103 | 104 | /** 105 | * Sets the callRate value for this ClientStatistics. 106 | * 107 | * @param callRate 108 | */ 109 | public void setCallRate(int callRate) { 110 | this.callRate = callRate; 111 | } 112 | 113 | private java.lang.Object __equalsCalc = null; 114 | public synchronized boolean equals(java.lang.Object obj) { 115 | if (!(obj instanceof ClientStatistics)) return false; 116 | ClientStatistics other = (ClientStatistics) obj; 117 | if (obj == null) return false; 118 | if (this == obj) return true; 119 | if (__equalsCalc != null) { 120 | return (__equalsCalc == obj); 121 | } 122 | __equalsCalc = obj; 123 | boolean _equals; 124 | _equals = true && 125 | ((this.client==null && other.getClient()==null) || 126 | (this.client!=null && 127 | this.client.equals(other.getClient()))) && 128 | this.totalClientSessions == other.getTotalClientSessions() && 129 | this.activeClientSessions == other.getActiveClientSessions() && 130 | this.callRate == other.getCallRate(); 131 | __equalsCalc = null; 132 | return _equals; 133 | } 134 | 135 | private boolean __hashCodeCalc = false; 136 | public synchronized int hashCode() { 137 | if (__hashCodeCalc) { 138 | return 0; 139 | } 140 | __hashCodeCalc = true; 141 | int _hashCode = 1; 142 | if (getClient() != null) { 143 | _hashCode += getClient().hashCode(); 144 | } 145 | _hashCode += getTotalClientSessions(); 146 | _hashCode += getActiveClientSessions(); 147 | _hashCode += getCallRate(); 148 | __hashCodeCalc = false; 149 | return _hashCode; 150 | } 151 | 152 | // Type metadata 153 | private static org.apache.axis.description.TypeDesc typeDesc = 154 | new org.apache.axis.description.TypeDesc(ClientStatistics.class, true); 155 | 156 | static { 157 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "ClientStatistics")); 158 | org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); 159 | elemField.setFieldName("client"); 160 | elemField.setXmlName(new javax.xml.namespace.QName("", "Client")); 161 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 162 | elemField.setMinOccurs(0); 163 | elemField.setNillable(true); 164 | typeDesc.addFieldDesc(elemField); 165 | elemField = new org.apache.axis.description.ElementDesc(); 166 | elemField.setFieldName("totalClientSessions"); 167 | elemField.setXmlName(new javax.xml.namespace.QName("", "TotalClientSessions")); 168 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); 169 | elemField.setNillable(false); 170 | typeDesc.addFieldDesc(elemField); 171 | elemField = new org.apache.axis.description.ElementDesc(); 172 | elemField.setFieldName("activeClientSessions"); 173 | elemField.setXmlName(new javax.xml.namespace.QName("", "ActiveClientSessions")); 174 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); 175 | elemField.setNillable(false); 176 | typeDesc.addFieldDesc(elemField); 177 | elemField = new org.apache.axis.description.ElementDesc(); 178 | elemField.setFieldName("callRate"); 179 | elemField.setXmlName(new javax.xml.namespace.QName("", "CallRate")); 180 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int")); 181 | elemField.setNillable(false); 182 | typeDesc.addFieldDesc(elemField); 183 | } 184 | 185 | /** 186 | * Return type metadata object 187 | */ 188 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 189 | return typeDesc; 190 | } 191 | 192 | /** 193 | * Get Custom Serializer 194 | */ 195 | public static org.apache.axis.encoding.Serializer getSerializer( 196 | java.lang.String mechType, 197 | java.lang.Class _javaType, 198 | javax.xml.namespace.QName _xmlType) { 199 | return 200 | new org.apache.axis.encoding.ser.BeanSerializer( 201 | _javaType, _xmlType, typeDesc); 202 | } 203 | 204 | /** 205 | * Get Custom Deserializer 206 | */ 207 | public static org.apache.axis.encoding.Deserializer getDeserializer( 208 | java.lang.String mechType, 209 | java.lang.Class _javaType, 210 | javax.xml.namespace.QName _xmlType) { 211 | return 212 | new org.apache.axis.encoding.ser.BeanDeserializer( 213 | _javaType, _xmlType, typeDesc); 214 | } 215 | 216 | } 217 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc/ConfirmationInfo.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ConfirmationInfo.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc; 9 | 10 | public class ConfirmationInfo implements java.io.Serializable { 11 | private java.lang.String responderID; 12 | 13 | private java.lang.String producedAt; 14 | 15 | private com.codeborne.security.digidoc.CertificateInfo responderCertificate; 16 | 17 | public ConfirmationInfo() { 18 | } 19 | 20 | public ConfirmationInfo( 21 | java.lang.String responderID, 22 | java.lang.String producedAt, 23 | com.codeborne.security.digidoc.CertificateInfo responderCertificate) { 24 | this.responderID = responderID; 25 | this.producedAt = producedAt; 26 | this.responderCertificate = responderCertificate; 27 | } 28 | 29 | 30 | /** 31 | * Gets the responderID value for this ConfirmationInfo. 32 | * 33 | * @return responderID 34 | */ 35 | public java.lang.String getResponderID() { 36 | return responderID; 37 | } 38 | 39 | 40 | /** 41 | * Sets the responderID value for this ConfirmationInfo. 42 | * 43 | * @param responderID 44 | */ 45 | public void setResponderID(java.lang.String responderID) { 46 | this.responderID = responderID; 47 | } 48 | 49 | 50 | /** 51 | * Gets the producedAt value for this ConfirmationInfo. 52 | * 53 | * @return producedAt 54 | */ 55 | public java.lang.String getProducedAt() { 56 | return producedAt; 57 | } 58 | 59 | 60 | /** 61 | * Sets the producedAt value for this ConfirmationInfo. 62 | * 63 | * @param producedAt 64 | */ 65 | public void setProducedAt(java.lang.String producedAt) { 66 | this.producedAt = producedAt; 67 | } 68 | 69 | 70 | /** 71 | * Gets the responderCertificate value for this ConfirmationInfo. 72 | * 73 | * @return responderCertificate 74 | */ 75 | public com.codeborne.security.digidoc.CertificateInfo getResponderCertificate() { 76 | return responderCertificate; 77 | } 78 | 79 | 80 | /** 81 | * Sets the responderCertificate value for this ConfirmationInfo. 82 | * 83 | * @param responderCertificate 84 | */ 85 | public void setResponderCertificate(com.codeborne.security.digidoc.CertificateInfo responderCertificate) { 86 | this.responderCertificate = responderCertificate; 87 | } 88 | 89 | private java.lang.Object __equalsCalc = null; 90 | public synchronized boolean equals(java.lang.Object obj) { 91 | if (!(obj instanceof ConfirmationInfo)) return false; 92 | ConfirmationInfo other = (ConfirmationInfo) obj; 93 | if (obj == null) return false; 94 | if (this == obj) return true; 95 | if (__equalsCalc != null) { 96 | return (__equalsCalc == obj); 97 | } 98 | __equalsCalc = obj; 99 | boolean _equals; 100 | _equals = true && 101 | ((this.responderID==null && other.getResponderID()==null) || 102 | (this.responderID!=null && 103 | this.responderID.equals(other.getResponderID()))) && 104 | ((this.producedAt==null && other.getProducedAt()==null) || 105 | (this.producedAt!=null && 106 | this.producedAt.equals(other.getProducedAt()))) && 107 | ((this.responderCertificate==null && other.getResponderCertificate()==null) || 108 | (this.responderCertificate!=null && 109 | this.responderCertificate.equals(other.getResponderCertificate()))); 110 | __equalsCalc = null; 111 | return _equals; 112 | } 113 | 114 | private boolean __hashCodeCalc = false; 115 | public synchronized int hashCode() { 116 | if (__hashCodeCalc) { 117 | return 0; 118 | } 119 | __hashCodeCalc = true; 120 | int _hashCode = 1; 121 | if (getResponderID() != null) { 122 | _hashCode += getResponderID().hashCode(); 123 | } 124 | if (getProducedAt() != null) { 125 | _hashCode += getProducedAt().hashCode(); 126 | } 127 | if (getResponderCertificate() != null) { 128 | _hashCode += getResponderCertificate().hashCode(); 129 | } 130 | __hashCodeCalc = false; 131 | return _hashCode; 132 | } 133 | 134 | // Type metadata 135 | private static org.apache.axis.description.TypeDesc typeDesc = 136 | new org.apache.axis.description.TypeDesc(ConfirmationInfo.class, true); 137 | 138 | static { 139 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "ConfirmationInfo")); 140 | org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); 141 | elemField.setFieldName("responderID"); 142 | elemField.setXmlName(new javax.xml.namespace.QName("", "ResponderID")); 143 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 144 | elemField.setMinOccurs(0); 145 | elemField.setNillable(true); 146 | typeDesc.addFieldDesc(elemField); 147 | elemField = new org.apache.axis.description.ElementDesc(); 148 | elemField.setFieldName("producedAt"); 149 | elemField.setXmlName(new javax.xml.namespace.QName("", "ProducedAt")); 150 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 151 | elemField.setMinOccurs(0); 152 | elemField.setNillable(true); 153 | typeDesc.addFieldDesc(elemField); 154 | elemField = new org.apache.axis.description.ElementDesc(); 155 | elemField.setFieldName("responderCertificate"); 156 | elemField.setXmlName(new javax.xml.namespace.QName("", "ResponderCertificate")); 157 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "CertificateInfo")); 158 | elemField.setMinOccurs(0); 159 | elemField.setNillable(true); 160 | typeDesc.addFieldDesc(elemField); 161 | } 162 | 163 | /** 164 | * Return type metadata object 165 | */ 166 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 167 | return typeDesc; 168 | } 169 | 170 | /** 171 | * Get Custom Serializer 172 | */ 173 | public static org.apache.axis.encoding.Serializer getSerializer( 174 | java.lang.String mechType, 175 | java.lang.Class _javaType, 176 | javax.xml.namespace.QName _xmlType) { 177 | return 178 | new org.apache.axis.encoding.ser.BeanSerializer( 179 | _javaType, _xmlType, typeDesc); 180 | } 181 | 182 | /** 183 | * Get Custom Deserializer 184 | */ 185 | public static org.apache.axis.encoding.Deserializer getDeserializer( 186 | java.lang.String mechType, 187 | java.lang.Class _javaType, 188 | javax.xml.namespace.QName _xmlType) { 189 | return 190 | new org.apache.axis.encoding.ser.BeanDeserializer( 191 | _javaType, _xmlType, typeDesc); 192 | } 193 | 194 | } 195 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc/DataFileAttribute.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DataFileAttribute.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc; 9 | 10 | public class DataFileAttribute implements java.io.Serializable { 11 | private java.lang.String name; 12 | 13 | private java.lang.String value; 14 | 15 | public DataFileAttribute() { 16 | } 17 | 18 | public DataFileAttribute( 19 | java.lang.String name, 20 | java.lang.String value) { 21 | this.name = name; 22 | this.value = value; 23 | } 24 | 25 | 26 | /** 27 | * Gets the name value for this DataFileAttribute. 28 | * 29 | * @return name 30 | */ 31 | public java.lang.String getName() { 32 | return name; 33 | } 34 | 35 | 36 | /** 37 | * Sets the name value for this DataFileAttribute. 38 | * 39 | * @param name 40 | */ 41 | public void setName(java.lang.String name) { 42 | this.name = name; 43 | } 44 | 45 | 46 | /** 47 | * Gets the value value for this DataFileAttribute. 48 | * 49 | * @return value 50 | */ 51 | public java.lang.String getValue() { 52 | return value; 53 | } 54 | 55 | 56 | /** 57 | * Sets the value value for this DataFileAttribute. 58 | * 59 | * @param value 60 | */ 61 | public void setValue(java.lang.String value) { 62 | this.value = value; 63 | } 64 | 65 | private java.lang.Object __equalsCalc = null; 66 | public synchronized boolean equals(java.lang.Object obj) { 67 | if (!(obj instanceof DataFileAttribute)) return false; 68 | DataFileAttribute other = (DataFileAttribute) obj; 69 | if (obj == null) return false; 70 | if (this == obj) return true; 71 | if (__equalsCalc != null) { 72 | return (__equalsCalc == obj); 73 | } 74 | __equalsCalc = obj; 75 | boolean _equals; 76 | _equals = true && 77 | ((this.name==null && other.getName()==null) || 78 | (this.name!=null && 79 | this.name.equals(other.getName()))) && 80 | ((this.value==null && other.getValue()==null) || 81 | (this.value!=null && 82 | this.value.equals(other.getValue()))); 83 | __equalsCalc = null; 84 | return _equals; 85 | } 86 | 87 | private boolean __hashCodeCalc = false; 88 | public synchronized int hashCode() { 89 | if (__hashCodeCalc) { 90 | return 0; 91 | } 92 | __hashCodeCalc = true; 93 | int _hashCode = 1; 94 | if (getName() != null) { 95 | _hashCode += getName().hashCode(); 96 | } 97 | if (getValue() != null) { 98 | _hashCode += getValue().hashCode(); 99 | } 100 | __hashCodeCalc = false; 101 | return _hashCode; 102 | } 103 | 104 | // Type metadata 105 | private static org.apache.axis.description.TypeDesc typeDesc = 106 | new org.apache.axis.description.TypeDesc(DataFileAttribute.class, true); 107 | 108 | static { 109 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "DataFileAttribute")); 110 | org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); 111 | elemField.setFieldName("name"); 112 | elemField.setXmlName(new javax.xml.namespace.QName("", "Name")); 113 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 114 | elemField.setMinOccurs(0); 115 | elemField.setNillable(true); 116 | typeDesc.addFieldDesc(elemField); 117 | elemField = new org.apache.axis.description.ElementDesc(); 118 | elemField.setFieldName("value"); 119 | elemField.setXmlName(new javax.xml.namespace.QName("", "Value")); 120 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 121 | elemField.setMinOccurs(0); 122 | elemField.setNillable(true); 123 | typeDesc.addFieldDesc(elemField); 124 | } 125 | 126 | /** 127 | * Return type metadata object 128 | */ 129 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 130 | return typeDesc; 131 | } 132 | 133 | /** 134 | * Get Custom Serializer 135 | */ 136 | public static org.apache.axis.encoding.Serializer getSerializer( 137 | java.lang.String mechType, 138 | java.lang.Class _javaType, 139 | javax.xml.namespace.QName _xmlType) { 140 | return 141 | new org.apache.axis.encoding.ser.BeanSerializer( 142 | _javaType, _xmlType, typeDesc); 143 | } 144 | 145 | /** 146 | * Get Custom Deserializer 147 | */ 148 | public static org.apache.axis.encoding.Deserializer getDeserializer( 149 | java.lang.String mechType, 150 | java.lang.Class _javaType, 151 | javax.xml.namespace.QName _xmlType) { 152 | return 153 | new org.apache.axis.encoding.ser.BeanDeserializer( 154 | _javaType, _xmlType, typeDesc); 155 | } 156 | 157 | } 158 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc/DataFileDigest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DataFileDigest.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc; 9 | 10 | public class DataFileDigest implements java.io.Serializable { 11 | private java.lang.String id; 12 | 13 | private java.lang.String digestType; 14 | 15 | private java.lang.String digestValue; 16 | 17 | public DataFileDigest() { 18 | } 19 | 20 | public DataFileDigest( 21 | java.lang.String id, 22 | java.lang.String digestType, 23 | java.lang.String digestValue) { 24 | this.id = id; 25 | this.digestType = digestType; 26 | this.digestValue = digestValue; 27 | } 28 | 29 | 30 | /** 31 | * Gets the id value for this DataFileDigest. 32 | * 33 | * @return id 34 | */ 35 | public java.lang.String getId() { 36 | return id; 37 | } 38 | 39 | 40 | /** 41 | * Sets the id value for this DataFileDigest. 42 | * 43 | * @param id 44 | */ 45 | public void setId(java.lang.String id) { 46 | this.id = id; 47 | } 48 | 49 | 50 | /** 51 | * Gets the digestType value for this DataFileDigest. 52 | * 53 | * @return digestType 54 | */ 55 | public java.lang.String getDigestType() { 56 | return digestType; 57 | } 58 | 59 | 60 | /** 61 | * Sets the digestType value for this DataFileDigest. 62 | * 63 | * @param digestType 64 | */ 65 | public void setDigestType(java.lang.String digestType) { 66 | this.digestType = digestType; 67 | } 68 | 69 | 70 | /** 71 | * Gets the digestValue value for this DataFileDigest. 72 | * 73 | * @return digestValue 74 | */ 75 | public java.lang.String getDigestValue() { 76 | return digestValue; 77 | } 78 | 79 | 80 | /** 81 | * Sets the digestValue value for this DataFileDigest. 82 | * 83 | * @param digestValue 84 | */ 85 | public void setDigestValue(java.lang.String digestValue) { 86 | this.digestValue = digestValue; 87 | } 88 | 89 | private java.lang.Object __equalsCalc = null; 90 | public synchronized boolean equals(java.lang.Object obj) { 91 | if (!(obj instanceof DataFileDigest)) return false; 92 | DataFileDigest other = (DataFileDigest) obj; 93 | if (obj == null) return false; 94 | if (this == obj) return true; 95 | if (__equalsCalc != null) { 96 | return (__equalsCalc == obj); 97 | } 98 | __equalsCalc = obj; 99 | boolean _equals; 100 | _equals = true && 101 | ((this.id==null && other.getId()==null) || 102 | (this.id!=null && 103 | this.id.equals(other.getId()))) && 104 | ((this.digestType==null && other.getDigestType()==null) || 105 | (this.digestType!=null && 106 | this.digestType.equals(other.getDigestType()))) && 107 | ((this.digestValue==null && other.getDigestValue()==null) || 108 | (this.digestValue!=null && 109 | this.digestValue.equals(other.getDigestValue()))); 110 | __equalsCalc = null; 111 | return _equals; 112 | } 113 | 114 | private boolean __hashCodeCalc = false; 115 | public synchronized int hashCode() { 116 | if (__hashCodeCalc) { 117 | return 0; 118 | } 119 | __hashCodeCalc = true; 120 | int _hashCode = 1; 121 | if (getId() != null) { 122 | _hashCode += getId().hashCode(); 123 | } 124 | if (getDigestType() != null) { 125 | _hashCode += getDigestType().hashCode(); 126 | } 127 | if (getDigestValue() != null) { 128 | _hashCode += getDigestValue().hashCode(); 129 | } 130 | __hashCodeCalc = false; 131 | return _hashCode; 132 | } 133 | 134 | // Type metadata 135 | private static org.apache.axis.description.TypeDesc typeDesc = 136 | new org.apache.axis.description.TypeDesc(DataFileDigest.class, true); 137 | 138 | static { 139 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "DataFileDigest")); 140 | org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); 141 | elemField.setFieldName("id"); 142 | elemField.setXmlName(new javax.xml.namespace.QName("", "Id")); 143 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 144 | elemField.setMinOccurs(0); 145 | elemField.setNillable(true); 146 | typeDesc.addFieldDesc(elemField); 147 | elemField = new org.apache.axis.description.ElementDesc(); 148 | elemField.setFieldName("digestType"); 149 | elemField.setXmlName(new javax.xml.namespace.QName("", "DigestType")); 150 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 151 | elemField.setMinOccurs(0); 152 | elemField.setNillable(true); 153 | typeDesc.addFieldDesc(elemField); 154 | elemField = new org.apache.axis.description.ElementDesc(); 155 | elemField.setFieldName("digestValue"); 156 | elemField.setXmlName(new javax.xml.namespace.QName("", "DigestValue")); 157 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 158 | elemField.setMinOccurs(0); 159 | elemField.setNillable(true); 160 | typeDesc.addFieldDesc(elemField); 161 | } 162 | 163 | /** 164 | * Return type metadata object 165 | */ 166 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 167 | return typeDesc; 168 | } 169 | 170 | /** 171 | * Get Custom Serializer 172 | */ 173 | public static org.apache.axis.encoding.Serializer getSerializer( 174 | java.lang.String mechType, 175 | java.lang.Class _javaType, 176 | javax.xml.namespace.QName _xmlType) { 177 | return 178 | new org.apache.axis.encoding.ser.BeanSerializer( 179 | _javaType, _xmlType, typeDesc); 180 | } 181 | 182 | /** 183 | * Get Custom Deserializer 184 | */ 185 | public static org.apache.axis.encoding.Deserializer getDeserializer( 186 | java.lang.String mechType, 187 | java.lang.Class _javaType, 188 | javax.xml.namespace.QName _xmlType) { 189 | return 190 | new org.apache.axis.encoding.ser.BeanDeserializer( 191 | _javaType, _xmlType, typeDesc); 192 | } 193 | 194 | } 195 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc/DataFileDigestList.java: -------------------------------------------------------------------------------- 1 | /** 2 | * DataFileDigestList.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc; 9 | 10 | public class DataFileDigestList implements java.io.Serializable { 11 | private com.codeborne.security.digidoc.DataFileDigest[] dataFileDigest; 12 | 13 | public DataFileDigestList() { 14 | } 15 | 16 | public DataFileDigestList( 17 | com.codeborne.security.digidoc.DataFileDigest[] dataFileDigest) { 18 | this.dataFileDigest = dataFileDigest; 19 | } 20 | 21 | 22 | /** 23 | * Gets the dataFileDigest value for this DataFileDigestList. 24 | * 25 | * @return dataFileDigest 26 | */ 27 | public com.codeborne.security.digidoc.DataFileDigest[] getDataFileDigest() { 28 | return dataFileDigest; 29 | } 30 | 31 | 32 | /** 33 | * Sets the dataFileDigest value for this DataFileDigestList. 34 | * 35 | * @param dataFileDigest 36 | */ 37 | public void setDataFileDigest(com.codeborne.security.digidoc.DataFileDigest[] dataFileDigest) { 38 | this.dataFileDigest = dataFileDigest; 39 | } 40 | 41 | public com.codeborne.security.digidoc.DataFileDigest getDataFileDigest(int i) { 42 | return this.dataFileDigest[i]; 43 | } 44 | 45 | public void setDataFileDigest(int i, com.codeborne.security.digidoc.DataFileDigest _value) { 46 | this.dataFileDigest[i] = _value; 47 | } 48 | 49 | private java.lang.Object __equalsCalc = null; 50 | public synchronized boolean equals(java.lang.Object obj) { 51 | if (!(obj instanceof DataFileDigestList)) return false; 52 | DataFileDigestList other = (DataFileDigestList) obj; 53 | if (obj == null) return false; 54 | if (this == obj) return true; 55 | if (__equalsCalc != null) { 56 | return (__equalsCalc == obj); 57 | } 58 | __equalsCalc = obj; 59 | boolean _equals; 60 | _equals = true && 61 | ((this.dataFileDigest==null && other.getDataFileDigest()==null) || 62 | (this.dataFileDigest!=null && 63 | java.util.Arrays.equals(this.dataFileDigest, other.getDataFileDigest()))); 64 | __equalsCalc = null; 65 | return _equals; 66 | } 67 | 68 | private boolean __hashCodeCalc = false; 69 | public synchronized int hashCode() { 70 | if (__hashCodeCalc) { 71 | return 0; 72 | } 73 | __hashCodeCalc = true; 74 | int _hashCode = 1; 75 | if (getDataFileDigest() != null) { 76 | for (int i=0; 77 | iendpointError")); 128 | org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); 129 | elemField.setFieldName("message"); 130 | elemField.setXmlName(new javax.xml.namespace.QName("", "message")); 131 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 132 | elemField.setNillable(false); 133 | typeDesc.addFieldDesc(elemField); 134 | elemField = new org.apache.axis.description.ElementDesc(); 135 | elemField.setFieldName("reason"); 136 | elemField.setXmlName(new javax.xml.namespace.QName("", "reason")); 137 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 138 | elemField.setMinOccurs(0); 139 | elemField.setNillable(false); 140 | elemField.setMaxOccursUnbounded(true); 141 | typeDesc.addFieldDesc(elemField); 142 | } 143 | 144 | /** 145 | * Return type metadata object 146 | */ 147 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 148 | return typeDesc; 149 | } 150 | 151 | /** 152 | * Get Custom Serializer 153 | */ 154 | public static org.apache.axis.encoding.Serializer getSerializer( 155 | java.lang.String mechType, 156 | java.lang.Class _javaType, 157 | javax.xml.namespace.QName _xmlType) { 158 | return 159 | new org.apache.axis.encoding.ser.BeanSerializer( 160 | _javaType, _xmlType, typeDesc); 161 | } 162 | 163 | /** 164 | * Get Custom Deserializer 165 | */ 166 | public static org.apache.axis.encoding.Deserializer getDeserializer( 167 | java.lang.String mechType, 168 | java.lang.Class _javaType, 169 | javax.xml.namespace.QName _xmlType) { 170 | return 171 | new org.apache.axis.encoding.ser.BeanDeserializer( 172 | _javaType, _xmlType, typeDesc); 173 | } 174 | 175 | } 176 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc_v2/GetMobileAuthenticateStatusRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * GetMobileAuthenticateStatusRequest.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc_v2; 9 | 10 | public class GetMobileAuthenticateStatusRequest extends com.codeborne.security.digidoc_v2.AbstractGetStatusRequestType implements java.io.Serializable { 11 | /* If 'TRUE', certificate of the user is returned. 12 | * Certificate is useful if AP wants 13 | * to save it and/or 14 | * independently verify correctness 15 | * of the signature 16 | * and validation data. */ 17 | private java.lang.Boolean returnCertData; 18 | 19 | /* If 'TRUE', OCSP response to the certificate 20 | * validity query is returned. */ 21 | private java.lang.Boolean returnRevocationData; 22 | 23 | public GetMobileAuthenticateStatusRequest() { 24 | } 25 | 26 | public GetMobileAuthenticateStatusRequest( 27 | java.lang.String sesscode, 28 | java.lang.Boolean waitSignature, 29 | java.lang.Boolean returnCertData, 30 | java.lang.Boolean returnRevocationData) { 31 | super( 32 | sesscode, 33 | waitSignature); 34 | this.returnCertData = returnCertData; 35 | this.returnRevocationData = returnRevocationData; 36 | } 37 | 38 | 39 | /** 40 | * Gets the returnCertData value for this GetMobileAuthenticateStatusRequest. 41 | * 42 | * @return returnCertData * If 'TRUE', certificate of the user is returned. 43 | * Certificate is useful if AP wants 44 | * to save it and/or 45 | * independently verify correctness 46 | * of the signature 47 | * and validation data. 48 | */ 49 | public java.lang.Boolean getReturnCertData() { 50 | return returnCertData; 51 | } 52 | 53 | 54 | /** 55 | * Sets the returnCertData value for this GetMobileAuthenticateStatusRequest. 56 | * 57 | * @param returnCertData * If 'TRUE', certificate of the user is returned. 58 | * Certificate is useful if AP wants 59 | * to save it and/or 60 | * independently verify correctness 61 | * of the signature 62 | * and validation data. 63 | */ 64 | public void setReturnCertData(java.lang.Boolean returnCertData) { 65 | this.returnCertData = returnCertData; 66 | } 67 | 68 | 69 | /** 70 | * Gets the returnRevocationData value for this GetMobileAuthenticateStatusRequest. 71 | * 72 | * @return returnRevocationData * If 'TRUE', OCSP response to the certificate 73 | * validity query is returned. 74 | */ 75 | public java.lang.Boolean getReturnRevocationData() { 76 | return returnRevocationData; 77 | } 78 | 79 | 80 | /** 81 | * Sets the returnRevocationData value for this GetMobileAuthenticateStatusRequest. 82 | * 83 | * @param returnRevocationData * If 'TRUE', OCSP response to the certificate 84 | * validity query is returned. 85 | */ 86 | public void setReturnRevocationData(java.lang.Boolean returnRevocationData) { 87 | this.returnRevocationData = returnRevocationData; 88 | } 89 | 90 | private java.lang.Object __equalsCalc = null; 91 | public synchronized boolean equals(java.lang.Object obj) { 92 | if (!(obj instanceof GetMobileAuthenticateStatusRequest)) return false; 93 | GetMobileAuthenticateStatusRequest other = (GetMobileAuthenticateStatusRequest) obj; 94 | if (obj == null) return false; 95 | if (this == obj) return true; 96 | if (__equalsCalc != null) { 97 | return (__equalsCalc == obj); 98 | } 99 | __equalsCalc = obj; 100 | boolean _equals; 101 | _equals = super.equals(obj) && 102 | ((this.returnCertData==null && other.getReturnCertData()==null) || 103 | (this.returnCertData!=null && 104 | this.returnCertData.equals(other.getReturnCertData()))) && 105 | ((this.returnRevocationData==null && other.getReturnRevocationData()==null) || 106 | (this.returnRevocationData!=null && 107 | this.returnRevocationData.equals(other.getReturnRevocationData()))); 108 | __equalsCalc = null; 109 | return _equals; 110 | } 111 | 112 | private boolean __hashCodeCalc = false; 113 | public synchronized int hashCode() { 114 | if (__hashCodeCalc) { 115 | return 0; 116 | } 117 | __hashCodeCalc = true; 118 | int _hashCode = super.hashCode(); 119 | if (getReturnCertData() != null) { 120 | _hashCode += getReturnCertData().hashCode(); 121 | } 122 | if (getReturnRevocationData() != null) { 123 | _hashCode += getReturnRevocationData().hashCode(); 124 | } 125 | __hashCodeCalc = false; 126 | return _hashCode; 127 | } 128 | 129 | // Type metadata 130 | private static org.apache.axis.description.TypeDesc typeDesc = 131 | new org.apache.axis.description.TypeDesc(GetMobileAuthenticateStatusRequest.class, true); 132 | 133 | static { 134 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", ">GetMobileAuthenticateStatusRequest")); 135 | org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); 136 | elemField.setFieldName("returnCertData"); 137 | elemField.setXmlName(new javax.xml.namespace.QName("", "ReturnCertData")); 138 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean")); 139 | elemField.setMinOccurs(0); 140 | elemField.setNillable(false); 141 | typeDesc.addFieldDesc(elemField); 142 | elemField = new org.apache.axis.description.ElementDesc(); 143 | elemField.setFieldName("returnRevocationData"); 144 | elemField.setXmlName(new javax.xml.namespace.QName("", "ReturnRevocationData")); 145 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "boolean")); 146 | elemField.setMinOccurs(0); 147 | elemField.setNillable(false); 148 | typeDesc.addFieldDesc(elemField); 149 | } 150 | 151 | /** 152 | * Return type metadata object 153 | */ 154 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 155 | return typeDesc; 156 | } 157 | 158 | /** 159 | * Get Custom Serializer 160 | */ 161 | public static org.apache.axis.encoding.Serializer getSerializer( 162 | java.lang.String mechType, 163 | java.lang.Class _javaType, 164 | javax.xml.namespace.QName _xmlType) { 165 | return 166 | new org.apache.axis.encoding.ser.BeanSerializer( 167 | _javaType, _xmlType, typeDesc); 168 | } 169 | 170 | /** 171 | * Get Custom Deserializer 172 | */ 173 | public static org.apache.axis.encoding.Deserializer getDeserializer( 174 | java.lang.String mechType, 175 | java.lang.Class _javaType, 176 | javax.xml.namespace.QName _xmlType) { 177 | return 178 | new org.apache.axis.encoding.ser.BeanDeserializer( 179 | _javaType, _xmlType, typeDesc); 180 | } 181 | 182 | } 183 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc_v2/GetMobileSignHashStatusRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * GetMobileSignHashStatusRequest.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc_v2; 9 | 10 | public class GetMobileSignHashStatusRequest extends com.codeborne.security.digidoc_v2.AbstractGetStatusRequestType implements java.io.Serializable { 11 | public GetMobileSignHashStatusRequest() { 12 | } 13 | 14 | public GetMobileSignHashStatusRequest( 15 | java.lang.String sesscode, 16 | java.lang.Boolean waitSignature) { 17 | super( 18 | sesscode, 19 | waitSignature); 20 | } 21 | 22 | private java.lang.Object __equalsCalc = null; 23 | public synchronized boolean equals(java.lang.Object obj) { 24 | if (!(obj instanceof GetMobileSignHashStatusRequest)) return false; 25 | GetMobileSignHashStatusRequest other = (GetMobileSignHashStatusRequest) obj; 26 | if (obj == null) return false; 27 | if (this == obj) return true; 28 | if (__equalsCalc != null) { 29 | return (__equalsCalc == obj); 30 | } 31 | __equalsCalc = obj; 32 | boolean _equals; 33 | _equals = super.equals(obj); 34 | __equalsCalc = null; 35 | return _equals; 36 | } 37 | 38 | private boolean __hashCodeCalc = false; 39 | public synchronized int hashCode() { 40 | if (__hashCodeCalc) { 41 | return 0; 42 | } 43 | __hashCodeCalc = true; 44 | int _hashCode = super.hashCode(); 45 | __hashCodeCalc = false; 46 | return _hashCode; 47 | } 48 | 49 | // Type metadata 50 | private static org.apache.axis.description.TypeDesc typeDesc = 51 | new org.apache.axis.description.TypeDesc(GetMobileSignHashStatusRequest.class, true); 52 | 53 | static { 54 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", ">GetMobileSignHashStatusRequest")); 55 | } 56 | 57 | /** 58 | * Return type metadata object 59 | */ 60 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 61 | return typeDesc; 62 | } 63 | 64 | /** 65 | * Get Custom Serializer 66 | */ 67 | public static org.apache.axis.encoding.Serializer getSerializer( 68 | java.lang.String mechType, 69 | java.lang.Class _javaType, 70 | javax.xml.namespace.QName _xmlType) { 71 | return 72 | new org.apache.axis.encoding.ser.BeanSerializer( 73 | _javaType, _xmlType, typeDesc); 74 | } 75 | 76 | /** 77 | * Get Custom Deserializer 78 | */ 79 | public static org.apache.axis.encoding.Deserializer getDeserializer( 80 | java.lang.String mechType, 81 | java.lang.Class _javaType, 82 | javax.xml.namespace.QName _xmlType) { 83 | return 84 | new org.apache.axis.encoding.ser.BeanDeserializer( 85 | _javaType, _xmlType, typeDesc); 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc_v2/HashType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * HashType.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc_v2; 9 | 10 | public class HashType implements java.io.Serializable { 11 | private java.lang.String _value_; 12 | private static java.util.HashMap _table_ = new java.util.HashMap(); 13 | 14 | // Constructor 15 | protected HashType(java.lang.String value) { 16 | _value_ = value; 17 | _table_.put(_value_,this); 18 | } 19 | 20 | public static final java.lang.String _SHA1 = "SHA1"; 21 | public static final java.lang.String _SHA256 = "SHA256"; 22 | public static final java.lang.String _SHA512 = "SHA512"; 23 | public static final HashType SHA1 = new HashType(_SHA1); 24 | public static final HashType SHA256 = new HashType(_SHA256); 25 | public static final HashType SHA512 = new HashType(_SHA512); 26 | public java.lang.String getValue() { return _value_;} 27 | public static HashType fromValue(java.lang.String value) 28 | throws java.lang.IllegalArgumentException { 29 | HashType enumeration = (HashType) 30 | _table_.get(value); 31 | if (enumeration==null) throw new java.lang.IllegalArgumentException(); 32 | return enumeration; 33 | } 34 | public static HashType fromString(java.lang.String value) 35 | throws java.lang.IllegalArgumentException { 36 | return fromValue(value); 37 | } 38 | public boolean equals(java.lang.Object obj) {return (obj == this);} 39 | public int hashCode() { return toString().hashCode();} 40 | public java.lang.String toString() { return _value_;} 41 | public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} 42 | public static org.apache.axis.encoding.Serializer getSerializer( 43 | java.lang.String mechType, 44 | java.lang.Class _javaType, 45 | javax.xml.namespace.QName _xmlType) { 46 | return 47 | new org.apache.axis.encoding.ser.EnumSerializer( 48 | _javaType, _xmlType); 49 | } 50 | public static org.apache.axis.encoding.Deserializer getDeserializer( 51 | java.lang.String mechType, 52 | java.lang.Class _javaType, 53 | javax.xml.namespace.QName _xmlType) { 54 | return 55 | new org.apache.axis.encoding.ser.EnumDeserializer( 56 | _javaType, _xmlType); 57 | } 58 | // Type metadata 59 | private static org.apache.axis.description.TypeDesc typeDesc = 60 | new org.apache.axis.description.TypeDesc(HashType.class); 61 | 62 | static { 63 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "HashType")); 64 | } 65 | /** 66 | * Return type metadata object 67 | */ 68 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 69 | return typeDesc; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc_v2/KeyID.java: -------------------------------------------------------------------------------- 1 | /** 2 | * KeyID.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc_v2; 9 | 10 | public class KeyID implements java.io.Serializable { 11 | private java.lang.String _value_; 12 | private static java.util.HashMap _table_ = new java.util.HashMap(); 13 | 14 | // Constructor 15 | protected KeyID(java.lang.String value) { 16 | _value_ = value; 17 | _table_.put(_value_,this); 18 | } 19 | 20 | public static final java.lang.String _RSA = "RSA"; 21 | public static final java.lang.String _ECC = "ECC"; 22 | public static final java.lang.String _SIGN_RSA = "SIGN_RSA"; 23 | public static final java.lang.String _SIGN_ECC = "SIGN_ECC"; 24 | public static final java.lang.String _AUTH_RSA = "AUTH_RSA"; 25 | public static final java.lang.String _AUTH_ECC = "AUTH_ECC"; 26 | public static final KeyID RSA = new KeyID(_RSA); 27 | public static final KeyID ECC = new KeyID(_ECC); 28 | public static final KeyID SIGN_RSA = new KeyID(_SIGN_RSA); 29 | public static final KeyID SIGN_ECC = new KeyID(_SIGN_ECC); 30 | public static final KeyID AUTH_RSA = new KeyID(_AUTH_RSA); 31 | public static final KeyID AUTH_ECC = new KeyID(_AUTH_ECC); 32 | public java.lang.String getValue() { return _value_;} 33 | public static KeyID fromValue(java.lang.String value) 34 | throws java.lang.IllegalArgumentException { 35 | KeyID enumeration = (KeyID) 36 | _table_.get(value); 37 | if (enumeration==null) throw new java.lang.IllegalArgumentException(); 38 | return enumeration; 39 | } 40 | public static KeyID fromString(java.lang.String value) 41 | throws java.lang.IllegalArgumentException { 42 | return fromValue(value); 43 | } 44 | public boolean equals(java.lang.Object obj) {return (obj == this);} 45 | public int hashCode() { return toString().hashCode();} 46 | public java.lang.String toString() { return _value_;} 47 | public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} 48 | public static org.apache.axis.encoding.Serializer getSerializer( 49 | java.lang.String mechType, 50 | java.lang.Class _javaType, 51 | javax.xml.namespace.QName _xmlType) { 52 | return 53 | new org.apache.axis.encoding.ser.EnumSerializer( 54 | _javaType, _xmlType); 55 | } 56 | public static org.apache.axis.encoding.Deserializer getDeserializer( 57 | java.lang.String mechType, 58 | java.lang.Class _javaType, 59 | javax.xml.namespace.QName _xmlType) { 60 | return 61 | new org.apache.axis.encoding.ser.EnumDeserializer( 62 | _javaType, _xmlType); 63 | } 64 | // Type metadata 65 | private static org.apache.axis.description.TypeDesc typeDesc = 66 | new org.apache.axis.description.TypeDesc(KeyID.class); 67 | 68 | static { 69 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "KeyID")); 70 | } 71 | /** 72 | * Return type metadata object 73 | */ 74 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 75 | return typeDesc; 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc_v2/LanguageType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * LanguageType.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc_v2; 9 | 10 | public class LanguageType implements java.io.Serializable { 11 | private java.lang.String _value_; 12 | private static java.util.HashMap _table_ = new java.util.HashMap(); 13 | 14 | // Constructor 15 | protected LanguageType(java.lang.String value) { 16 | _value_ = value; 17 | _table_.put(_value_,this); 18 | } 19 | 20 | public static final java.lang.String _EST = "EST"; 21 | public static final java.lang.String _LIT = "LIT"; 22 | public static final java.lang.String _RUS = "RUS"; 23 | public static final java.lang.String _ENG = "ENG"; 24 | public static final LanguageType EST = new LanguageType(_EST); 25 | public static final LanguageType LIT = new LanguageType(_LIT); 26 | public static final LanguageType RUS = new LanguageType(_RUS); 27 | public static final LanguageType ENG = new LanguageType(_ENG); 28 | public java.lang.String getValue() { return _value_;} 29 | public static LanguageType fromValue(java.lang.String value) 30 | throws java.lang.IllegalArgumentException { 31 | LanguageType enumeration = (LanguageType) 32 | _table_.get(value); 33 | if (enumeration==null) throw new java.lang.IllegalArgumentException(); 34 | return enumeration; 35 | } 36 | public static LanguageType fromString(java.lang.String value) 37 | throws java.lang.IllegalArgumentException { 38 | return fromValue(value); 39 | } 40 | public boolean equals(java.lang.Object obj) {return (obj == this);} 41 | public int hashCode() { return toString().hashCode();} 42 | public java.lang.String toString() { return _value_;} 43 | public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} 44 | public static org.apache.axis.encoding.Serializer getSerializer( 45 | java.lang.String mechType, 46 | java.lang.Class _javaType, 47 | javax.xml.namespace.QName _xmlType) { 48 | return 49 | new org.apache.axis.encoding.ser.EnumSerializer( 50 | _javaType, _xmlType); 51 | } 52 | public static org.apache.axis.encoding.Deserializer getDeserializer( 53 | java.lang.String mechType, 54 | java.lang.Class _javaType, 55 | javax.xml.namespace.QName _xmlType) { 56 | return 57 | new org.apache.axis.encoding.ser.EnumDeserializer( 58 | _javaType, _xmlType); 59 | } 60 | // Type metadata 61 | private static org.apache.axis.description.TypeDesc typeDesc = 62 | new org.apache.axis.description.TypeDesc(LanguageType.class); 63 | 64 | static { 65 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "LanguageType")); 66 | } 67 | /** 68 | * Return type metadata object 69 | */ 70 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 71 | return typeDesc; 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc_v2/MobileAuthenticateRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MobileAuthenticateRequest.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc_v2; 9 | 10 | public class MobileAuthenticateRequest extends com.codeborne.security.digidoc_v2.AbstractRequestType implements java.io.Serializable { 11 | /* 10-byte random challenge generated by the 12 | * Application Provider witch would 13 | * be part of the 14 | * message for 15 | * signing by user during authentication. 16 | * Must be in HEX form. 17 | * NB! 18 | * For security reasons it’s recommended 19 | * to 20 | * always fill this 21 | * parameter with different random 22 | * value every time. */ 23 | private java.lang.String SPChallenge; 24 | 25 | public MobileAuthenticateRequest() { 26 | } 27 | 28 | public MobileAuthenticateRequest( 29 | java.lang.String IDCode, 30 | java.lang.String phoneNo, 31 | com.codeborne.security.digidoc_v2.LanguageType language, 32 | java.lang.String serviceName, 33 | java.lang.String messageToDisplay, 34 | java.lang.String SPChallenge) { 35 | super( 36 | IDCode, 37 | phoneNo, 38 | language, 39 | serviceName, 40 | messageToDisplay); 41 | this.SPChallenge = SPChallenge; 42 | } 43 | 44 | 45 | /** 46 | * Gets the SPChallenge value for this MobileAuthenticateRequest. 47 | * 48 | * @return SPChallenge * 10-byte random challenge generated by the 49 | * Application Provider witch would 50 | * be part of the 51 | * message for 52 | * signing by user during authentication. 53 | * Must be in HEX form. 54 | * NB! 55 | * For security reasons it’s recommended 56 | * to 57 | * always fill this 58 | * parameter with different random 59 | * value every time. 60 | */ 61 | public java.lang.String getSPChallenge() { 62 | return SPChallenge; 63 | } 64 | 65 | 66 | /** 67 | * Sets the SPChallenge value for this MobileAuthenticateRequest. 68 | * 69 | * @param SPChallenge * 10-byte random challenge generated by the 70 | * Application Provider witch would 71 | * be part of the 72 | * message for 73 | * signing by user during authentication. 74 | * Must be in HEX form. 75 | * NB! 76 | * For security reasons it’s recommended 77 | * to 78 | * always fill this 79 | * parameter with different random 80 | * value every time. 81 | */ 82 | public void setSPChallenge(java.lang.String SPChallenge) { 83 | this.SPChallenge = SPChallenge; 84 | } 85 | 86 | private java.lang.Object __equalsCalc = null; 87 | public synchronized boolean equals(java.lang.Object obj) { 88 | if (!(obj instanceof MobileAuthenticateRequest)) return false; 89 | MobileAuthenticateRequest other = (MobileAuthenticateRequest) obj; 90 | if (obj == null) return false; 91 | if (this == obj) return true; 92 | if (__equalsCalc != null) { 93 | return (__equalsCalc == obj); 94 | } 95 | __equalsCalc = obj; 96 | boolean _equals; 97 | _equals = super.equals(obj) && 98 | ((this.SPChallenge==null && other.getSPChallenge()==null) || 99 | (this.SPChallenge!=null && 100 | this.SPChallenge.equals(other.getSPChallenge()))); 101 | __equalsCalc = null; 102 | return _equals; 103 | } 104 | 105 | private boolean __hashCodeCalc = false; 106 | public synchronized int hashCode() { 107 | if (__hashCodeCalc) { 108 | return 0; 109 | } 110 | __hashCodeCalc = true; 111 | int _hashCode = super.hashCode(); 112 | if (getSPChallenge() != null) { 113 | _hashCode += getSPChallenge().hashCode(); 114 | } 115 | __hashCodeCalc = false; 116 | return _hashCode; 117 | } 118 | 119 | // Type metadata 120 | private static org.apache.axis.description.TypeDesc typeDesc = 121 | new org.apache.axis.description.TypeDesc(MobileAuthenticateRequest.class, true); 122 | 123 | static { 124 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", ">MobileAuthenticateRequest")); 125 | org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); 126 | elemField.setFieldName("SPChallenge"); 127 | elemField.setXmlName(new javax.xml.namespace.QName("", "SPChallenge")); 128 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 129 | elemField.setMinOccurs(0); 130 | elemField.setNillable(false); 131 | typeDesc.addFieldDesc(elemField); 132 | } 133 | 134 | /** 135 | * Return type metadata object 136 | */ 137 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 138 | return typeDesc; 139 | } 140 | 141 | /** 142 | * Get Custom Serializer 143 | */ 144 | public static org.apache.axis.encoding.Serializer getSerializer( 145 | java.lang.String mechType, 146 | java.lang.Class _javaType, 147 | javax.xml.namespace.QName _xmlType) { 148 | return 149 | new org.apache.axis.encoding.ser.BeanSerializer( 150 | _javaType, _xmlType, typeDesc); 151 | } 152 | 153 | /** 154 | * Get Custom Deserializer 155 | */ 156 | public static org.apache.axis.encoding.Deserializer getDeserializer( 157 | java.lang.String mechType, 158 | java.lang.Class _javaType, 159 | javax.xml.namespace.QName _xmlType) { 160 | return 161 | new org.apache.axis.encoding.ser.BeanDeserializer( 162 | _javaType, _xmlType, typeDesc); 163 | } 164 | 165 | } 166 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc_v2/MobileAuthenticateResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MobileAuthenticateResponse.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc_v2; 9 | 10 | public class MobileAuthenticateResponse extends com.codeborne.security.digidoc_v2.AbstractResponseType implements java.io.Serializable { 11 | /* The data to be signed by the user. Consists of mixture of 12 | * data sent by Application Provider 13 | * in SPChallenge (10 14 | * bytes) field of the query and 15 | * data added by DigiDocService (also 10 16 | * bytes). 17 | * Returned only if SPChallenge field 18 | * in the query was set. */ 19 | private java.lang.String challenge; 20 | 21 | public MobileAuthenticateResponse() { 22 | } 23 | 24 | public MobileAuthenticateResponse( 25 | java.lang.String sesscode, 26 | java.lang.String challengeID, 27 | java.lang.String challenge) { 28 | super( 29 | sesscode, 30 | challengeID); 31 | this.challenge = challenge; 32 | } 33 | 34 | 35 | /** 36 | * Gets the challenge value for this MobileAuthenticateResponse. 37 | * 38 | * @return challenge * The data to be signed by the user. Consists of mixture of 39 | * data sent by Application Provider 40 | * in SPChallenge (10 41 | * bytes) field of the query and 42 | * data added by DigiDocService (also 10 43 | * bytes). 44 | * Returned only if SPChallenge field 45 | * in the query was set. 46 | */ 47 | public java.lang.String getChallenge() { 48 | return challenge; 49 | } 50 | 51 | 52 | /** 53 | * Sets the challenge value for this MobileAuthenticateResponse. 54 | * 55 | * @param challenge * The data to be signed by the user. Consists of mixture of 56 | * data sent by Application Provider 57 | * in SPChallenge (10 58 | * bytes) field of the query and 59 | * data added by DigiDocService (also 10 60 | * bytes). 61 | * Returned only if SPChallenge field 62 | * in the query was set. 63 | */ 64 | public void setChallenge(java.lang.String challenge) { 65 | this.challenge = challenge; 66 | } 67 | 68 | private java.lang.Object __equalsCalc = null; 69 | public synchronized boolean equals(java.lang.Object obj) { 70 | if (!(obj instanceof MobileAuthenticateResponse)) return false; 71 | MobileAuthenticateResponse other = (MobileAuthenticateResponse) obj; 72 | if (obj == null) return false; 73 | if (this == obj) return true; 74 | if (__equalsCalc != null) { 75 | return (__equalsCalc == obj); 76 | } 77 | __equalsCalc = obj; 78 | boolean _equals; 79 | _equals = super.equals(obj) && 80 | ((this.challenge==null && other.getChallenge()==null) || 81 | (this.challenge!=null && 82 | this.challenge.equals(other.getChallenge()))); 83 | __equalsCalc = null; 84 | return _equals; 85 | } 86 | 87 | private boolean __hashCodeCalc = false; 88 | public synchronized int hashCode() { 89 | if (__hashCodeCalc) { 90 | return 0; 91 | } 92 | __hashCodeCalc = true; 93 | int _hashCode = super.hashCode(); 94 | if (getChallenge() != null) { 95 | _hashCode += getChallenge().hashCode(); 96 | } 97 | __hashCodeCalc = false; 98 | return _hashCode; 99 | } 100 | 101 | // Type metadata 102 | private static org.apache.axis.description.TypeDesc typeDesc = 103 | new org.apache.axis.description.TypeDesc(MobileAuthenticateResponse.class, true); 104 | 105 | static { 106 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", ">MobileAuthenticateResponse")); 107 | org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); 108 | elemField.setFieldName("challenge"); 109 | elemField.setXmlName(new javax.xml.namespace.QName("", "Challenge")); 110 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 111 | elemField.setMinOccurs(0); 112 | elemField.setNillable(false); 113 | typeDesc.addFieldDesc(elemField); 114 | } 115 | 116 | /** 117 | * Return type metadata object 118 | */ 119 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 120 | return typeDesc; 121 | } 122 | 123 | /** 124 | * Get Custom Serializer 125 | */ 126 | public static org.apache.axis.encoding.Serializer getSerializer( 127 | java.lang.String mechType, 128 | java.lang.Class _javaType, 129 | javax.xml.namespace.QName _xmlType) { 130 | return 131 | new org.apache.axis.encoding.ser.BeanSerializer( 132 | _javaType, _xmlType, typeDesc); 133 | } 134 | 135 | /** 136 | * Get Custom Deserializer 137 | */ 138 | public static org.apache.axis.encoding.Deserializer getDeserializer( 139 | java.lang.String mechType, 140 | java.lang.Class _javaType, 141 | javax.xml.namespace.QName _xmlType) { 142 | return 143 | new org.apache.axis.encoding.ser.BeanDeserializer( 144 | _javaType, _xmlType, typeDesc); 145 | } 146 | 147 | } 148 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc_v2/MobileId.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MobileId.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc_v2; 9 | 10 | public interface MobileId extends java.rmi.Remote { 11 | public com.codeborne.security.digidoc_v2.MobileSignHashResponse mobileSignHash(com.codeborne.security.digidoc_v2.MobileSignHashRequest mobileSignHashRequest) throws java.rmi.RemoteException; 12 | public com.codeborne.security.digidoc_v2.GetMobileSignHashStatusResponse getMobileSignHashStatus(com.codeborne.security.digidoc_v2.GetMobileSignHashStatusRequest getMobileSignHashStatusRequest) throws java.rmi.RemoteException; 13 | } 14 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc_v2/MobileIdService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MobileIdService.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc_v2; 9 | 10 | public interface MobileIdService extends javax.xml.rpc.Service { 11 | public java.lang.String getMobileIdServiceAddress(); 12 | 13 | public com.codeborne.security.digidoc_v2.MobileId getMobileIdService() throws javax.xml.rpc.ServiceException; 14 | 15 | public com.codeborne.security.digidoc_v2.MobileId getMobileIdService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; 16 | } 17 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc_v2/MobileIdServiceLocator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MobileIdServiceLocator.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc_v2; 9 | 10 | public class MobileIdServiceLocator extends org.apache.axis.client.Service implements com.codeborne.security.digidoc_v2.MobileIdService { 11 | 12 | public MobileIdServiceLocator() { 13 | } 14 | 15 | 16 | public MobileIdServiceLocator(org.apache.axis.EngineConfiguration config) { 17 | super(config); 18 | } 19 | 20 | public MobileIdServiceLocator(java.lang.String wsdlLoc, javax.xml.namespace.QName sName) throws javax.xml.rpc.ServiceException { 21 | super(wsdlLoc, sName); 22 | } 23 | 24 | // Use to get a proxy class for MobileIdService 25 | private java.lang.String MobileIdService_address = "https://digidocservice.sk.ee/v2/"; 26 | 27 | public java.lang.String getMobileIdServiceAddress() { 28 | return MobileIdService_address; 29 | } 30 | 31 | // The WSDD service name defaults to the port name. 32 | private java.lang.String MobileIdServiceWSDDServiceName = "MobileIdService"; 33 | 34 | public java.lang.String getMobileIdServiceWSDDServiceName() { 35 | return MobileIdServiceWSDDServiceName; 36 | } 37 | 38 | public void setMobileIdServiceWSDDServiceName(java.lang.String name) { 39 | MobileIdServiceWSDDServiceName = name; 40 | } 41 | 42 | public com.codeborne.security.digidoc_v2.MobileId getMobileIdService() throws javax.xml.rpc.ServiceException { 43 | java.net.URL endpoint; 44 | try { 45 | endpoint = new java.net.URL(MobileIdService_address); 46 | } 47 | catch (java.net.MalformedURLException e) { 48 | throw new javax.xml.rpc.ServiceException(e); 49 | } 50 | return getMobileIdService(endpoint); 51 | } 52 | 53 | public com.codeborne.security.digidoc_v2.MobileId getMobileIdService(java.net.URL portAddress) throws javax.xml.rpc.ServiceException { 54 | try { 55 | com.codeborne.security.digidoc_v2.MobileIdServiceStub _stub = new com.codeborne.security.digidoc_v2.MobileIdServiceStub(portAddress, this); 56 | _stub.setPortName(getMobileIdServiceWSDDServiceName()); 57 | return _stub; 58 | } 59 | catch (org.apache.axis.AxisFault e) { 60 | return null; 61 | } 62 | } 63 | 64 | public void setMobileIdServiceEndpointAddress(java.lang.String address) { 65 | MobileIdService_address = address; 66 | } 67 | 68 | /** 69 | * For the given interface, get the stub implementation. 70 | * If this service has no port for the given interface, 71 | * then ServiceException is thrown. 72 | */ 73 | public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { 74 | try { 75 | if (com.codeborne.security.digidoc_v2.MobileId.class.isAssignableFrom(serviceEndpointInterface)) { 76 | com.codeborne.security.digidoc_v2.MobileIdServiceStub _stub = new com.codeborne.security.digidoc_v2.MobileIdServiceStub(new java.net.URL(MobileIdService_address), this); 77 | _stub.setPortName(getMobileIdServiceWSDDServiceName()); 78 | return _stub; 79 | } 80 | } 81 | catch (java.lang.Throwable t) { 82 | throw new javax.xml.rpc.ServiceException(t); 83 | } 84 | throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName())); 85 | } 86 | 87 | /** 88 | * For the given interface, get the stub implementation. 89 | * If this service has no port for the given interface, 90 | * then ServiceException is thrown. 91 | */ 92 | public java.rmi.Remote getPort(javax.xml.namespace.QName portName, Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException { 93 | if (portName == null) { 94 | return getPort(serviceEndpointInterface); 95 | } 96 | java.lang.String inputPortName = portName.getLocalPart(); 97 | if ("MobileIdService".equals(inputPortName)) { 98 | return getMobileIdService(); 99 | } 100 | else { 101 | java.rmi.Remote _stub = getPort(serviceEndpointInterface); 102 | ((org.apache.axis.client.Stub) _stub).setPortName(portName); 103 | return _stub; 104 | } 105 | } 106 | 107 | public javax.xml.namespace.QName getServiceName() { 108 | return new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "MobileIdService"); 109 | } 110 | 111 | private java.util.HashSet ports = null; 112 | 113 | public java.util.Iterator getPorts() { 114 | if (ports == null) { 115 | ports = new java.util.HashSet(); 116 | ports.add(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "MobileIdService")); 117 | } 118 | return ports.iterator(); 119 | } 120 | 121 | /** 122 | * Set the endpoint address for the specified port name. 123 | */ 124 | public void setEndpointAddress(java.lang.String portName, java.lang.String address) throws javax.xml.rpc.ServiceException { 125 | 126 | if ("MobileIdService".equals(portName)) { 127 | setMobileIdServiceEndpointAddress(address); 128 | } 129 | else 130 | { // Unknown Port Name 131 | throw new javax.xml.rpc.ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName); 132 | } 133 | } 134 | 135 | /** 136 | * Set the endpoint address for the specified port name. 137 | */ 138 | public void setEndpointAddress(javax.xml.namespace.QName portName, java.lang.String address) throws javax.xml.rpc.ServiceException { 139 | setEndpointAddress(portName.getLocalPart(), address); 140 | } 141 | 142 | } 143 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc_v2/MobileSignHashRequest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MobileSignHashRequest.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc_v2; 9 | 10 | public class MobileSignHashRequest extends com.codeborne.security.digidoc_v2.AbstractRequestType implements java.io.Serializable { 11 | /* Hash to sign in HEX form. */ 12 | private java.lang.String hash; 13 | 14 | /* Hash algorithm */ 15 | private com.codeborne.security.digidoc_v2.HashType hashType; 16 | 17 | /* Key algorithm to sign the hash */ 18 | private com.codeborne.security.digidoc_v2.KeyID keyID; 19 | 20 | public MobileSignHashRequest() { 21 | } 22 | 23 | public MobileSignHashRequest( 24 | java.lang.String IDCode, 25 | java.lang.String phoneNo, 26 | com.codeborne.security.digidoc_v2.LanguageType language, 27 | java.lang.String serviceName, 28 | java.lang.String messageToDisplay, 29 | java.lang.String hash, 30 | com.codeborne.security.digidoc_v2.HashType hashType, 31 | com.codeborne.security.digidoc_v2.KeyID keyID) { 32 | super( 33 | IDCode, 34 | phoneNo, 35 | language, 36 | serviceName, 37 | messageToDisplay); 38 | this.hash = hash; 39 | this.hashType = hashType; 40 | this.keyID = keyID; 41 | } 42 | 43 | 44 | /** 45 | * Gets the hash value for this MobileSignHashRequest. 46 | * 47 | * @return hash * Hash to sign in HEX form. 48 | */ 49 | public java.lang.String getHash() { 50 | return hash; 51 | } 52 | 53 | 54 | /** 55 | * Sets the hash value for this MobileSignHashRequest. 56 | * 57 | * @param hash * Hash to sign in HEX form. 58 | */ 59 | public void setHash(java.lang.String hash) { 60 | this.hash = hash; 61 | } 62 | 63 | 64 | /** 65 | * Gets the hashType value for this MobileSignHashRequest. 66 | * 67 | * @return hashType * Hash algorithm 68 | */ 69 | public com.codeborne.security.digidoc_v2.HashType getHashType() { 70 | return hashType; 71 | } 72 | 73 | 74 | /** 75 | * Sets the hashType value for this MobileSignHashRequest. 76 | * 77 | * @param hashType * Hash algorithm 78 | */ 79 | public void setHashType(com.codeborne.security.digidoc_v2.HashType hashType) { 80 | this.hashType = hashType; 81 | } 82 | 83 | 84 | /** 85 | * Gets the keyID value for this MobileSignHashRequest. 86 | * 87 | * @return keyID * Key algorithm to sign the hash 88 | */ 89 | public com.codeborne.security.digidoc_v2.KeyID getKeyID() { 90 | return keyID; 91 | } 92 | 93 | 94 | /** 95 | * Sets the keyID value for this MobileSignHashRequest. 96 | * 97 | * @param keyID * Key algorithm to sign the hash 98 | */ 99 | public void setKeyID(com.codeborne.security.digidoc_v2.KeyID keyID) { 100 | this.keyID = keyID; 101 | } 102 | 103 | private java.lang.Object __equalsCalc = null; 104 | public synchronized boolean equals(java.lang.Object obj) { 105 | if (!(obj instanceof MobileSignHashRequest)) return false; 106 | MobileSignHashRequest other = (MobileSignHashRequest) obj; 107 | if (obj == null) return false; 108 | if (this == obj) return true; 109 | if (__equalsCalc != null) { 110 | return (__equalsCalc == obj); 111 | } 112 | __equalsCalc = obj; 113 | boolean _equals; 114 | _equals = super.equals(obj) && 115 | ((this.hash==null && other.getHash()==null) || 116 | (this.hash!=null && 117 | this.hash.equals(other.getHash()))) && 118 | ((this.hashType==null && other.getHashType()==null) || 119 | (this.hashType!=null && 120 | this.hashType.equals(other.getHashType()))) && 121 | ((this.keyID==null && other.getKeyID()==null) || 122 | (this.keyID!=null && 123 | this.keyID.equals(other.getKeyID()))); 124 | __equalsCalc = null; 125 | return _equals; 126 | } 127 | 128 | private boolean __hashCodeCalc = false; 129 | public synchronized int hashCode() { 130 | if (__hashCodeCalc) { 131 | return 0; 132 | } 133 | __hashCodeCalc = true; 134 | int _hashCode = super.hashCode(); 135 | if (getHash() != null) { 136 | _hashCode += getHash().hashCode(); 137 | } 138 | if (getHashType() != null) { 139 | _hashCode += getHashType().hashCode(); 140 | } 141 | if (getKeyID() != null) { 142 | _hashCode += getKeyID().hashCode(); 143 | } 144 | __hashCodeCalc = false; 145 | return _hashCode; 146 | } 147 | 148 | // Type metadata 149 | private static org.apache.axis.description.TypeDesc typeDesc = 150 | new org.apache.axis.description.TypeDesc(MobileSignHashRequest.class, true); 151 | 152 | static { 153 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", ">MobileSignHashRequest")); 154 | org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); 155 | elemField.setFieldName("hash"); 156 | elemField.setXmlName(new javax.xml.namespace.QName("", "Hash")); 157 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 158 | elemField.setNillable(false); 159 | typeDesc.addFieldDesc(elemField); 160 | elemField = new org.apache.axis.description.ElementDesc(); 161 | elemField.setFieldName("hashType"); 162 | elemField.setXmlName(new javax.xml.namespace.QName("", "HashType")); 163 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "HashType")); 164 | elemField.setNillable(false); 165 | typeDesc.addFieldDesc(elemField); 166 | elemField = new org.apache.axis.description.ElementDesc(); 167 | elemField.setFieldName("keyID"); 168 | elemField.setXmlName(new javax.xml.namespace.QName("", "KeyID")); 169 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "KeyID")); 170 | elemField.setMinOccurs(0); 171 | elemField.setNillable(false); 172 | typeDesc.addFieldDesc(elemField); 173 | } 174 | 175 | /** 176 | * Return type metadata object 177 | */ 178 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 179 | return typeDesc; 180 | } 181 | 182 | /** 183 | * Get Custom Serializer 184 | */ 185 | public static org.apache.axis.encoding.Serializer getSerializer( 186 | java.lang.String mechType, 187 | java.lang.Class _javaType, 188 | javax.xml.namespace.QName _xmlType) { 189 | return 190 | new org.apache.axis.encoding.ser.BeanSerializer( 191 | _javaType, _xmlType, typeDesc); 192 | } 193 | 194 | /** 195 | * Get Custom Deserializer 196 | */ 197 | public static org.apache.axis.encoding.Deserializer getDeserializer( 198 | java.lang.String mechType, 199 | java.lang.Class _javaType, 200 | javax.xml.namespace.QName _xmlType) { 201 | return 202 | new org.apache.axis.encoding.ser.BeanDeserializer( 203 | _javaType, _xmlType, typeDesc); 204 | } 205 | 206 | } 207 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc_v2/MobileSignHashResponse.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MobileSignHashResponse.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc_v2; 9 | 10 | public class MobileSignHashResponse extends com.codeborne.security.digidoc_v2.AbstractResponseType implements java.io.Serializable { 11 | private java.lang.String status; 12 | 13 | public MobileSignHashResponse() { 14 | } 15 | 16 | public MobileSignHashResponse( 17 | java.lang.String sesscode, 18 | java.lang.String challengeID, 19 | java.lang.String status) { 20 | super( 21 | sesscode, 22 | challengeID); 23 | this.status = status; 24 | } 25 | 26 | 27 | /** 28 | * Gets the status value for this MobileSignHashResponse. 29 | * 30 | * @return status 31 | */ 32 | public java.lang.String getStatus() { 33 | return status; 34 | } 35 | 36 | 37 | /** 38 | * Sets the status value for this MobileSignHashResponse. 39 | * 40 | * @param status 41 | */ 42 | public void setStatus(java.lang.String status) { 43 | this.status = status; 44 | } 45 | 46 | private java.lang.Object __equalsCalc = null; 47 | public synchronized boolean equals(java.lang.Object obj) { 48 | if (!(obj instanceof MobileSignHashResponse)) return false; 49 | MobileSignHashResponse other = (MobileSignHashResponse) obj; 50 | if (obj == null) return false; 51 | if (this == obj) return true; 52 | if (__equalsCalc != null) { 53 | return (__equalsCalc == obj); 54 | } 55 | __equalsCalc = obj; 56 | boolean _equals; 57 | _equals = super.equals(obj) && 58 | ((this.status==null && other.getStatus()==null) || 59 | (this.status!=null && 60 | this.status.equals(other.getStatus()))); 61 | __equalsCalc = null; 62 | return _equals; 63 | } 64 | 65 | private boolean __hashCodeCalc = false; 66 | public synchronized int hashCode() { 67 | if (__hashCodeCalc) { 68 | return 0; 69 | } 70 | __hashCodeCalc = true; 71 | int _hashCode = super.hashCode(); 72 | if (getStatus() != null) { 73 | _hashCode += getStatus().hashCode(); 74 | } 75 | __hashCodeCalc = false; 76 | return _hashCode; 77 | } 78 | 79 | // Type metadata 80 | private static org.apache.axis.description.TypeDesc typeDesc = 81 | new org.apache.axis.description.TypeDesc(MobileSignHashResponse.class, true); 82 | 83 | static { 84 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", ">MobileSignHashResponse")); 85 | org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); 86 | elemField.setFieldName("status"); 87 | elemField.setXmlName(new javax.xml.namespace.QName("", "Status")); 88 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 89 | elemField.setNillable(false); 90 | typeDesc.addFieldDesc(elemField); 91 | } 92 | 93 | /** 94 | * Return type metadata object 95 | */ 96 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 97 | return typeDesc; 98 | } 99 | 100 | /** 101 | * Get Custom Serializer 102 | */ 103 | public static org.apache.axis.encoding.Serializer getSerializer( 104 | java.lang.String mechType, 105 | java.lang.Class _javaType, 106 | javax.xml.namespace.QName _xmlType) { 107 | return 108 | new org.apache.axis.encoding.ser.BeanSerializer( 109 | _javaType, _xmlType, typeDesc); 110 | } 111 | 112 | /** 113 | * Get Custom Deserializer 114 | */ 115 | public static org.apache.axis.encoding.Deserializer getDeserializer( 116 | java.lang.String mechType, 117 | java.lang.Class _javaType, 118 | javax.xml.namespace.QName _xmlType) { 119 | return 120 | new org.apache.axis.encoding.ser.BeanDeserializer( 121 | _javaType, _xmlType, typeDesc); 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc_v2/ProcessStatusType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ProcessStatusType.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc_v2; 9 | 10 | public class ProcessStatusType implements java.io.Serializable { 11 | private java.lang.String _value_; 12 | private static java.util.HashMap _table_ = new java.util.HashMap(); 13 | 14 | // Constructor 15 | protected ProcessStatusType(java.lang.String value) { 16 | _value_ = value; 17 | _table_.put(_value_,this); 18 | } 19 | 20 | public static final java.lang.String _EXPIRED_TRANSACTION = "EXPIRED_TRANSACTION"; 21 | public static final java.lang.String _USER_AUTHENTICATED = "USER_AUTHENTICATED"; 22 | public static final java.lang.String _USER_CANCEL = "USER_CANCEL"; 23 | public static final java.lang.String _SIGNATURE = "SIGNATURE"; 24 | public static final java.lang.String _OUTSTANDING_TRANSACTION = "OUTSTANDING_TRANSACTION"; 25 | public static final java.lang.String _MID_NOT_READY = "MID_NOT_READY"; 26 | public static final java.lang.String _PHONE_ABSENT = "PHONE_ABSENT"; 27 | public static final java.lang.String _SENDING_ERROR = "SENDING_ERROR"; 28 | public static final java.lang.String _SIM_ERROR = "SIM_ERROR"; 29 | public static final java.lang.String _OCSP_UNAUTHORIZED = "OCSP_UNAUTHORIZED"; 30 | public static final java.lang.String _INTERNAL_ERROR = "INTERNAL_ERROR"; 31 | public static final java.lang.String _REVOKED_CERTIFICATE = "REVOKED_CERTIFICATE"; 32 | public static final java.lang.String _NOT_VALID = "NOT_VALID"; 33 | public static final java.lang.String _PHONE_TIMEOUT = "PHONE_TIMEOUT"; 34 | public static final ProcessStatusType EXPIRED_TRANSACTION = new ProcessStatusType(_EXPIRED_TRANSACTION); 35 | public static final ProcessStatusType USER_AUTHENTICATED = new ProcessStatusType(_USER_AUTHENTICATED); 36 | public static final ProcessStatusType USER_CANCEL = new ProcessStatusType(_USER_CANCEL); 37 | public static final ProcessStatusType SIGNATURE = new ProcessStatusType(_SIGNATURE); 38 | public static final ProcessStatusType OUTSTANDING_TRANSACTION = new ProcessStatusType(_OUTSTANDING_TRANSACTION); 39 | public static final ProcessStatusType MID_NOT_READY = new ProcessStatusType(_MID_NOT_READY); 40 | public static final ProcessStatusType PHONE_ABSENT = new ProcessStatusType(_PHONE_ABSENT); 41 | public static final ProcessStatusType SENDING_ERROR = new ProcessStatusType(_SENDING_ERROR); 42 | public static final ProcessStatusType SIM_ERROR = new ProcessStatusType(_SIM_ERROR); 43 | public static final ProcessStatusType OCSP_UNAUTHORIZED = new ProcessStatusType(_OCSP_UNAUTHORIZED); 44 | public static final ProcessStatusType INTERNAL_ERROR = new ProcessStatusType(_INTERNAL_ERROR); 45 | public static final ProcessStatusType REVOKED_CERTIFICATE = new ProcessStatusType(_REVOKED_CERTIFICATE); 46 | public static final ProcessStatusType NOT_VALID = new ProcessStatusType(_NOT_VALID); 47 | public static final ProcessStatusType PHONE_TIMEOUT = new ProcessStatusType(_PHONE_TIMEOUT); 48 | public java.lang.String getValue() { return _value_;} 49 | public static ProcessStatusType fromValue(java.lang.String value) 50 | throws java.lang.IllegalArgumentException { 51 | ProcessStatusType enumeration = (ProcessStatusType) 52 | _table_.get(value); 53 | if (enumeration==null) throw new java.lang.IllegalArgumentException(); 54 | return enumeration; 55 | } 56 | public static ProcessStatusType fromString(java.lang.String value) 57 | throws java.lang.IllegalArgumentException { 58 | return fromValue(value); 59 | } 60 | public boolean equals(java.lang.Object obj) {return (obj == this);} 61 | public int hashCode() { return toString().hashCode();} 62 | public java.lang.String toString() { return _value_;} 63 | public java.lang.Object readResolve() throws java.io.ObjectStreamException { return fromValue(_value_);} 64 | public static org.apache.axis.encoding.Serializer getSerializer( 65 | java.lang.String mechType, 66 | java.lang.Class _javaType, 67 | javax.xml.namespace.QName _xmlType) { 68 | return 69 | new org.apache.axis.encoding.ser.EnumSerializer( 70 | _javaType, _xmlType); 71 | } 72 | public static org.apache.axis.encoding.Deserializer getDeserializer( 73 | java.lang.String mechType, 74 | java.lang.Class _javaType, 75 | javax.xml.namespace.QName _xmlType) { 76 | return 77 | new org.apache.axis.encoding.ser.EnumDeserializer( 78 | _javaType, _xmlType); 79 | } 80 | // Type metadata 81 | private static org.apache.axis.description.TypeDesc typeDesc = 82 | new org.apache.axis.description.TypeDesc(ProcessStatusType.class); 83 | 84 | static { 85 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "ProcessStatusType")); 86 | } 87 | /** 88 | * Return type metadata object 89 | */ 90 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 91 | return typeDesc; 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /src/com/codeborne/security/digidoc_v2/SessionAwareType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * SessionAwareType.java 3 | * 4 | * This file was auto-generated from WSDL 5 | * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. 6 | */ 7 | 8 | package com.codeborne.security.digidoc_v2; 9 | 10 | public abstract class SessionAwareType implements java.io.Serializable { 11 | /* Session identifier */ 12 | private java.lang.String sesscode; 13 | 14 | public SessionAwareType() { 15 | } 16 | 17 | public SessionAwareType( 18 | java.lang.String sesscode) { 19 | this.sesscode = sesscode; 20 | } 21 | 22 | 23 | /** 24 | * Gets the sesscode value for this SessionAwareType. 25 | * 26 | * @return sesscode * Session identifier 27 | */ 28 | public java.lang.String getSesscode() { 29 | return sesscode; 30 | } 31 | 32 | 33 | /** 34 | * Sets the sesscode value for this SessionAwareType. 35 | * 36 | * @param sesscode * Session identifier 37 | */ 38 | public void setSesscode(java.lang.String sesscode) { 39 | this.sesscode = sesscode; 40 | } 41 | 42 | private java.lang.Object __equalsCalc = null; 43 | public synchronized boolean equals(java.lang.Object obj) { 44 | if (!(obj instanceof SessionAwareType)) return false; 45 | SessionAwareType other = (SessionAwareType) obj; 46 | if (obj == null) return false; 47 | if (this == obj) return true; 48 | if (__equalsCalc != null) { 49 | return (__equalsCalc == obj); 50 | } 51 | __equalsCalc = obj; 52 | boolean _equals; 53 | _equals = true && 54 | ((this.sesscode==null && other.getSesscode()==null) || 55 | (this.sesscode!=null && 56 | this.sesscode.equals(other.getSesscode()))); 57 | __equalsCalc = null; 58 | return _equals; 59 | } 60 | 61 | private boolean __hashCodeCalc = false; 62 | public synchronized int hashCode() { 63 | if (__hashCodeCalc) { 64 | return 0; 65 | } 66 | __hashCodeCalc = true; 67 | int _hashCode = 1; 68 | if (getSesscode() != null) { 69 | _hashCode += getSesscode().hashCode(); 70 | } 71 | __hashCodeCalc = false; 72 | return _hashCode; 73 | } 74 | 75 | // Type metadata 76 | private static org.apache.axis.description.TypeDesc typeDesc = 77 | new org.apache.axis.description.TypeDesc(SessionAwareType.class, true); 78 | 79 | static { 80 | typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.sk.ee/DigiDocService/DigiDocService_2_3.wsdl", "SessionAwareType")); 81 | org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc(); 82 | elemField.setFieldName("sesscode"); 83 | elemField.setXmlName(new javax.xml.namespace.QName("", "Sesscode")); 84 | elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string")); 85 | elemField.setNillable(false); 86 | typeDesc.addFieldDesc(elemField); 87 | } 88 | 89 | /** 90 | * Return type metadata object 91 | */ 92 | public static org.apache.axis.description.TypeDesc getTypeDesc() { 93 | return typeDesc; 94 | } 95 | 96 | /** 97 | * Get Custom Serializer 98 | */ 99 | public static org.apache.axis.encoding.Serializer getSerializer( 100 | java.lang.String mechType, 101 | java.lang.Class _javaType, 102 | javax.xml.namespace.QName _xmlType) { 103 | return 104 | new org.apache.axis.encoding.ser.BeanSerializer( 105 | _javaType, _xmlType, typeDesc); 106 | } 107 | 108 | /** 109 | * Get Custom Deserializer 110 | */ 111 | public static org.apache.axis.encoding.Deserializer getDeserializer( 112 | java.lang.String mechType, 113 | java.lang.Class _javaType, 114 | javax.xml.namespace.QName _xmlType) { 115 | return 116 | new org.apache.axis.encoding.ser.BeanDeserializer( 117 | _javaType, _xmlType, typeDesc); 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /src/com/codeborne/security/mobileid/MobileIDSession.java: -------------------------------------------------------------------------------- 1 | package com.codeborne.security.mobileid; 2 | 3 | import java.io.Serializable; 4 | 5 | import static java.lang.Integer.parseInt; 6 | 7 | public class MobileIDSession implements Serializable { 8 | public final String firstName; 9 | public final String lastName; 10 | public final String personalCode; 11 | public final String challenge; 12 | public final int sessCode; 13 | 14 | public MobileIDSession(int sessCode, String challenge, String firstName, String lastName, String personalCode) { 15 | this.firstName = firstName; 16 | this.lastName = lastName; 17 | this.personalCode = personalCode; 18 | this.challenge = challenge; 19 | this.sessCode = sessCode; 20 | } 21 | 22 | public String getFullName() { 23 | return firstName + "\u00A0" + lastName; 24 | } 25 | 26 | @Override 27 | public String toString() { 28 | return sessCode + ":::" + challenge + ":::" + firstName + ":::" + lastName + ":::" + personalCode; 29 | } 30 | 31 | public static MobileIDSession fromString(String serializedMobileIDSession) { 32 | String[] tokens = serializedMobileIDSession.split(":::"); 33 | return new MobileIDSession(parseInt(tokens[0]), tokens[1], tokens[2], tokens[3], tokens[4]); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/com/codeborne/security/mobileid/test/MobileIDAuthenticatorStub.java: -------------------------------------------------------------------------------- 1 | package com.codeborne.security.mobileid.test; 2 | 3 | import com.codeborne.security.AuthenticationException; 4 | import com.codeborne.security.mobileid.MobileIDAuthenticator; 5 | import com.codeborne.security.mobileid.MobileIDSession; 6 | 7 | import static java.lang.Integer.parseInt; 8 | 9 | public class MobileIDAuthenticatorStub extends MobileIDAuthenticator { 10 | public long loginTimeMs = 1000; 11 | public String firstName = "Tõnis"; 12 | public String lastName = "Jäägup"; 13 | public String personalCode = "37259180809"; 14 | 15 | public MobileIDAuthenticatorStub() { 16 | } 17 | 18 | public MobileIDAuthenticatorStub(long loginTimeMs, String firstName, String lastName) { 19 | this.loginTimeMs = loginTimeMs; 20 | this.firstName = firstName; 21 | this.lastName = lastName; 22 | } 23 | 24 | @Override 25 | protected MobileIDSession startLogin(String personalCode, String countryCode, String phone) { 26 | if (phone == null || phone.length() < 5) { 27 | throw new AuthenticationException(AuthenticationException.Code.INVALID_INPUT, "Invalid PhoneNo", null); 28 | } 29 | else if (phone.startsWith("+37255")) { 30 | throw new AuthenticationException(AuthenticationException.Code.NO_AGREEMENT, "User is not a Mobile-ID client", null); 31 | } 32 | return new MobileIDSession(parseInt(phone.replaceFirst("\\+372(.*)", "$1")), "1234", firstName, lastName, personalCode == null ? this.personalCode : personalCode); 33 | } 34 | 35 | @Override 36 | public MobileIDSession waitForLogin(MobileIDSession session) { 37 | String phone = "+372" + session.sessCode; 38 | if (phone.startsWith("+37256")) { 39 | throw new AuthenticationException(AuthenticationException.Code.USER_CANCEL); 40 | } 41 | try { 42 | Thread.sleep(loginTimeMs); 43 | } catch (InterruptedException ignore) { 44 | } 45 | return session; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /test/com/codeborne/security/mobileid/HelloMobileID.java: -------------------------------------------------------------------------------- 1 | package com.codeborne.security.mobileid; 2 | 3 | import com.codeborne.security.AuthenticationException; 4 | 5 | import javax.swing.*; 6 | import java.awt.*; 7 | 8 | import static javax.swing.WindowConstants.EXIT_ON_CLOSE; 9 | 10 | /** 11 | * You can use the following test phone numbers: 12 | * https://www.id.ee/?id=36373 13 | */ 14 | public class HelloMobileID { 15 | private static final String TEST_DIGIDOC_SERVICE_URL = "https://tsp.demo.sk.ee/"; 16 | private MobileIDAuthenticator mid; 17 | private JFrame frame; 18 | private JTextField phone; 19 | private JLabel message; 20 | 21 | public static void main(String[] args) { 22 | System.setProperty("javax.net.ssl.trustStore", "test/keystore.jks"); 23 | HelloMobileID app = new HelloMobileID(); 24 | app.mid = new MobileIDAuthenticator(TEST_DIGIDOC_SERVICE_URL); 25 | app.create(); 26 | } 27 | 28 | private void login(String phoneNumber) { 29 | try { 30 | final MobileIDSession mobileIDSession = mid.startLogin(phoneNumber); 31 | showMessage("
Challenge: " + mobileIDSession.challenge + "
You will get SMS in few seconds.
Please accept it to login.
"); 32 | 33 | mid.waitForLogin(mobileIDSession); 34 | showMessage("You have logged in." + 35 | "
First name: " + mobileIDSession.firstName + 36 | "
Last name: " + mobileIDSession.lastName + 37 | "
Personal code: " + mobileIDSession.personalCode); 38 | } catch (AuthenticationException e) { 39 | e.printStackTrace(); 40 | showMessage("

" + e.getMessage() + "


"); 41 | } 42 | } 43 | 44 | private void showMessage(final String message) { 45 | SwingUtilities.invokeLater(() -> { 46 | HelloMobileID.this.message.setText("" + message + ""); 47 | frame.pack(); 48 | }); 49 | } 50 | 51 | private void create() { 52 | frame = new JFrame("Hello MobileID world"); 53 | frame.setContentPane(createContent()); 54 | 55 | frame.setDefaultCloseOperation(EXIT_ON_CLOSE); 56 | frame.setMinimumSize(new Dimension(300, 100)); 57 | frame.setPreferredSize(new Dimension(400, 200)); 58 | frame.pack(); 59 | frame.setVisible(true); 60 | } 61 | 62 | private JComponent createContent() { 63 | JButton button = new JButton("Login with MobileID"); 64 | button.addActionListener(e -> new Thread(() -> { 65 | showMessage("

Connecting to MobileID server...


"); 66 | login(phone.getText()); 67 | }).start()); 68 | 69 | message = new JLabel("

Enter your phone


"); 70 | phone = new JTextField("+372", 30); 71 | phone.setMaximumSize(new Dimension(50, 20)); 72 | 73 | JPanel panel = new JPanel(new FlowLayout()); 74 | panel.add(message); 75 | panel.add(phone); 76 | panel.add(button); 77 | return panel; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /test/com/codeborne/security/mobileid/HelloMobileIDByPersonalCode.java: -------------------------------------------------------------------------------- 1 | package com.codeborne.security.mobileid; 2 | 3 | import com.codeborne.security.AuthenticationException; 4 | 5 | import javax.swing.*; 6 | import java.awt.*; 7 | 8 | import static javax.swing.WindowConstants.EXIT_ON_CLOSE; 9 | 10 | /** 11 | * You can use the following test phone numbers: 12 | * https://www.id.ee/?id=36373 13 | */ 14 | public class HelloMobileIDByPersonalCode { 15 | private static final String TEST_DIGIDOC_SERVICE_URL = "https://tsp.demo.sk.ee/"; 16 | private MobileIDAuthenticator mid; 17 | private JFrame frame; 18 | private JTextField personalCode; 19 | private JLabel message; 20 | 21 | public static void main(String[] args) { 22 | System.setProperty("javax.net.ssl.trustStore", "test/keystore.jks"); 23 | HelloMobileIDByPersonalCode app = new HelloMobileIDByPersonalCode(); 24 | app.mid = new MobileIDAuthenticator(TEST_DIGIDOC_SERVICE_URL); 25 | app.create(); 26 | } 27 | 28 | private void login(String personalCode) { 29 | try { 30 | final MobileIDSession mobileIDSession = mid.startLogin(personalCode, "EE"); 31 | showMessage("
Challenge: " + mobileIDSession.challenge + "
You will get SMS in few seconds.
Please accept it to login.
"); 32 | 33 | mid.waitForLogin(mobileIDSession); 34 | showMessage("You have logged in." + 35 | "
First name: " + mobileIDSession.firstName + 36 | "
Last name: " + mobileIDSession.lastName + 37 | "
Personal code: " + mobileIDSession.personalCode); 38 | } catch (AuthenticationException e) { 39 | e.printStackTrace(); 40 | showMessage("

" + e.getMessage() + "


"); 41 | } 42 | } 43 | 44 | private void showMessage(final String message) { 45 | SwingUtilities.invokeLater(() -> { 46 | HelloMobileIDByPersonalCode.this.message.setText("" + message + ""); 47 | frame.pack(); 48 | }); 49 | } 50 | 51 | private void create() { 52 | frame = new JFrame("Hello MobileID world"); 53 | frame.setContentPane(createContent()); 54 | 55 | frame.setDefaultCloseOperation(EXIT_ON_CLOSE); 56 | frame.setMinimumSize(new Dimension(300, 100)); 57 | frame.setPreferredSize(new Dimension(400, 200)); 58 | frame.pack(); 59 | frame.setVisible(true); 60 | } 61 | 62 | private JComponent createContent() { 63 | JButton button = new JButton("Login with MobileID"); 64 | button.addActionListener(e -> new Thread(() -> { 65 | showMessage("

Connecting to MobileID server...


"); 66 | login(personalCode.getText()); 67 | }).start()); 68 | 69 | message = new JLabel("

Enter your personal code


"); 70 | personalCode = new JTextField("", 30); 71 | personalCode.setMaximumSize(new Dimension(50, 20)); 72 | 73 | JPanel panel = new JPanel(new FlowLayout()); 74 | panel.add(message); 75 | panel.add(personalCode); 76 | panel.add(button); 77 | return panel; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /test/com/codeborne/security/mobileid/MobileIDSessionTest.java: -------------------------------------------------------------------------------- 1 | package com.codeborne.security.mobileid; 2 | 3 | import org.junit.Test; 4 | 5 | import java.io.IOException; 6 | 7 | import static org.junit.Assert.assertEquals; 8 | 9 | public class MobileIDSessionTest { 10 | @Test 11 | public void canBeSerialized() throws IOException, ClassNotFoundException { 12 | MobileIDSession session = new MobileIDSession(-23, "1234", "Jänis", "Põldvere-Разумовский", "38112310010"); 13 | 14 | MobileIDSession sessionClone = MobileIDSession.fromString(session.toString()); 15 | assertEquals(-23, sessionClone.sessCode); 16 | assertEquals("1234", sessionClone.challenge); 17 | assertEquals("Jänis", sessionClone.firstName); 18 | assertEquals("Põldvere-Разумовский", sessionClone.lastName); 19 | assertEquals("38112310010", sessionClone.personalCode); 20 | } 21 | 22 | @Test 23 | public void serializationWithEmptyValues() throws IOException, ClassNotFoundException { 24 | MobileIDSession session = new MobileIDSession(0, "1234", "", "", "38112310010"); 25 | 26 | MobileIDSession sessionClone = MobileIDSession.fromString(session.toString()); 27 | assertEquals(0, sessionClone.sessCode); 28 | assertEquals("1234", sessionClone.challenge); 29 | assertEquals("", sessionClone.firstName); 30 | assertEquals("", sessionClone.lastName); 31 | assertEquals("38112310010", sessionClone.personalCode); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /test/com/codeborne/security/mobileid/test/MobileIDAuthenticatorStubTest.java: -------------------------------------------------------------------------------- 1 | package com.codeborne.security.mobileid.test; 2 | 3 | import com.codeborne.security.mobileid.MobileIDSession; 4 | import org.hamcrest.CoreMatchers; 5 | import org.junit.Test; 6 | 7 | import static org.hamcrest.CoreMatchers.equalTo; 8 | import static org.junit.Assert.assertThat; 9 | 10 | public class MobileIDAuthenticatorStubTest { 11 | private MobileIDAuthenticatorStub stub = new MobileIDAuthenticatorStub(); 12 | 13 | @Test 14 | public void emulatesMobileIdSession_withConstantUserData_and_givenPhoneNumber() { 15 | MobileIDSession mobileIDSession = stub.startLogin(null, null, "+372516273849"); 16 | 17 | assertThat(mobileIDSession.sessCode, equalTo(516273849)); 18 | assertThat(mobileIDSession.firstName, equalTo("Tõnis")); 19 | assertThat(mobileIDSession.lastName, equalTo("Jäägup")); 20 | assertThat(mobileIDSession.personalCode, equalTo("37259180809")); 21 | } 22 | } -------------------------------------------------------------------------------- /test/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeborne/mobileid/3902719f26146a94e2b6ca5d2ff79e571c634300/test/keystore.jks --------------------------------------------------------------------------------