All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ee.sk.smartid.AuthenticationIdentity Maven / Gradle / Ivy

Go to download

Smart-ID Java client is a Java library that can be used for easy integration of the Smart-ID solution to information systems or e-services

There is a newer version: 2.3
Show newest version
package ee.sk.smartid;

/*-
 * #%L
 * Smart ID sample Java client
 * %%
 * Copyright (C) 2018 SK ID Solutions AS
 * %%
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 * #L%
 */

import java.security.cert.X509Certificate;
import java.time.LocalDate;
import java.util.Optional;

public class AuthenticationIdentity {
  private String givenName;
  private String surname;
  private String identityNumber;
  private String country;
  private X509Certificate authCertificate;
  private LocalDate dateOfBirth;

  public AuthenticationIdentity() {
  }

  public AuthenticationIdentity(X509Certificate authCertificate) {
    this.authCertificate = authCertificate;
  }

  public String getGivenName() {
    return givenName;
  }

  public void setGivenName(String givenName) {
    this.givenName = givenName;
  }

  public String getSurname() {
    return surname;
  }

  public void setSurname(String surname) {
    this.surname = surname;
  }

  /**
   * Instead use:
   * @see this#getSurname()
   */
  @Deprecated
  public String getSurName() {
    return surname;
  }

  /**
   * Instead use:
   * @see this#setSurname(String)
   */
  @Deprecated
  public void setSurName(String surname) {
    this.surname = surname;
  }

  public String getIdentityNumber() {
    return identityNumber;
  }

  public void setIdentityNumber(String identityNumber) {
    this.identityNumber = identityNumber;
  }

  public String getIdentityCode() {
    return identityNumber;
  }

  public void setIdentityCode(String identityCode) {
    this.identityNumber = identityCode;
  }

  public String getCountry() {
    return country;
  }

  public void setCountry(String country) {
    this.country = country;
  }

  public X509Certificate getAuthCertificate() {
    return authCertificate;
  }

  public void setAuthCertificate(X509Certificate authCertificate) {
    this.authCertificate = authCertificate;
  }

  /**
   * Person date of birth.
   * NB! This information is not available for some Latvian certificates.
   *
   * @return Date of birth if this information is available in authentication response or empty optional.
   */
  public Optional getDateOfBirth() {
    return Optional.ofNullable(dateOfBirth);
  }

  public void setDateOfBirth(LocalDate dateOfBirth) {
    this.dateOfBirth = dateOfBirth;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy