J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * reserved comment block |
| 3 | * DO NOT REMOVE OR ALTER! |
| 4 | */ |
| 5 | |
| 6 | /* |
| 7 | * Copyright 1999-2004 The Apache Software Foundation. |
| 8 | * |
| 9 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 | * you may not use this file except in compliance with the License. |
| 11 | * You may obtain a copy of the License at |
| 12 | * |
| 13 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | * |
| 15 | * Unless required by applicable law or agreed to in writing, software |
| 16 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | * See the License for the specific language governing permissions and |
| 19 | * limitations under the License. |
| 20 | * |
| 21 | */ |
| 22 | package com.sun.org.apache.xml.internal.security.signature; |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | /** |
| 29 | * Thrown by {@link com.sun.org.apache.xml.internal.security.signature.SignedInfo#verify()} when |
| 30 | * testing the signature fails because of uninitialized |
| 31 | * {@link com.sun.org.apache.xml.internal.security.signature.Reference}s. |
| 32 | * |
| 33 | * @author Christian Geuer-Pollmann |
| 34 | * @see ReferenceNotInitializedException |
| 35 | */ |
| 36 | public class MissingResourceFailureException extends XMLSignatureException { |
| 37 | |
| 38 | /** |
| 39 | * |
| 40 | */ |
| 41 | private static final long serialVersionUID = 1L; |
| 42 | /** Field uninitializedReference */ |
| 43 | Reference uninitializedReference = null; |
| 44 | |
| 45 | /** |
| 46 | * MissingKeyResourceFailureException constructor. |
| 47 | * @param _msgID |
| 48 | * @param reference |
| 49 | * @see #getReference |
| 50 | */ |
| 51 | public MissingResourceFailureException(String _msgID, Reference reference) { |
| 52 | |
| 53 | super(_msgID); |
| 54 | |
| 55 | this.uninitializedReference = reference; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Constructor MissingResourceFailureException |
| 60 | * |
| 61 | * @param _msgID |
| 62 | * @param exArgs |
| 63 | * @param reference |
| 64 | * @see #getReference |
| 65 | */ |
| 66 | public MissingResourceFailureException(String _msgID, Object exArgs[], |
| 67 | Reference reference) { |
| 68 | |
| 69 | super(_msgID, exArgs); |
| 70 | |
| 71 | this.uninitializedReference = reference; |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * Constructor MissingResourceFailureException |
| 76 | * |
| 77 | * @param _msgID |
| 78 | * @param _originalException |
| 79 | * @param reference |
| 80 | * @see #getReference |
| 81 | */ |
| 82 | public MissingResourceFailureException(String _msgID, |
| 83 | Exception _originalException, |
| 84 | Reference reference) { |
| 85 | |
| 86 | super(_msgID, _originalException); |
| 87 | |
| 88 | this.uninitializedReference = reference; |
| 89 | } |
| 90 | |
| 91 | /** |
| 92 | * Constructor MissingResourceFailureException |
| 93 | * |
| 94 | * @param _msgID |
| 95 | * @param exArgs |
| 96 | * @param _originalException |
| 97 | * @param reference |
| 98 | * @see #getReference |
| 99 | */ |
| 100 | public MissingResourceFailureException(String _msgID, Object exArgs[], |
| 101 | Exception _originalException, |
| 102 | Reference reference) { |
| 103 | |
| 104 | super(_msgID, exArgs, _originalException); |
| 105 | |
| 106 | this.uninitializedReference = reference; |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * used to set the uninitialized {@link com.sun.org.apache.xml.internal.security.signature.Reference} |
| 111 | * |
| 112 | * @param reference the Reference object |
| 113 | * @see #getReference |
| 114 | */ |
| 115 | public void setReference(Reference reference) { |
| 116 | this.uninitializedReference = reference; |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * used to get the uninitialized {@link com.sun.org.apache.xml.internal.security.signature.Reference} |
| 121 | * |
| 122 | * This allows to supply the correct {@link com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput} |
| 123 | * to the {@link com.sun.org.apache.xml.internal.security.signature.Reference} to try again verification. |
| 124 | * |
| 125 | * @return the Reference object |
| 126 | * @see #setReference |
| 127 | */ |
| 128 | public Reference getReference() { |
| 129 | return this.uninitializedReference; |
| 130 | } |
| 131 | } |