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