/* * Kontalk Android client * Copyright (C) 2017 Kontalk Devteam <devteam@kontalk.org> * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.kontalk.crypto; import java.security.GeneralSecurityException; /** * Exception during verification. * @author Daniele Ricci */ public class VerifyException extends GeneralSecurityException { private static final long serialVersionUID = -3210114563479741397L; /** Signature verification failed. */ public static final int VERIFY_EXCEPTION_VERIFICATION_FAILED = DecryptException.DECRYPT_EXCEPTION_VERIFICATION_FAILED; /** Invalid packet data. */ public static final int VERIFY_EXCEPTION_INVALID_DATA = DecryptException.DECRYPT_EXCEPTION_INVALID_DATA; private final int mCode; public VerifyException(int code) { super(); mCode = code; } public VerifyException(int code, String message) { super(message); mCode = code; } public VerifyException(int code, Throwable cause) { super(cause); mCode = code; } public VerifyException(int code, Throwable cause, String message) { super(message, cause); mCode = code; } public int getCode() { return mCode; } }